return (u32*)((char*)bh->b_data + bh->b_size);
}
+/*
+ * Requires read_lock(&pointers_lock) or write_lock(&pointers_lock)
+ */
static Indirect *get_branch(struct inode *inode,
int depth,
int offsets[],
bh = sb_bread(sb, block);
if (!bh)
goto failure;
- read_lock(&pointers_lock);
if (!verify_chain(chain, p))
goto changed;
add_chain(++p, bh, (u32*)bh->b_data + *++offsets);
- read_unlock(&pointers_lock);
if (!p->key)
goto no_block;
}
return NULL;
changed:
- read_unlock(&pointers_lock);
brelse(bh);
*err = -EAGAIN;
goto no_block;
goto out;
reread:
+ read_lock(&pointers_lock);
partial = get_branch(inode, depth, offsets, chain, &err);
+ read_unlock(&pointers_lock);
/* Simplest case - block found, no allocation needed */
if (!partial) {