*/
int lafs_seg_ref_block(struct block *b, int ssnum)
{
- struct fs *fs;
- struct segsum *ss;
- struct block *b2, *p;
- struct inode *ino;
- int err;
+ struct fs *fs = fs_from_inode(b->inode);
getref(b, MKREF(segref));
while (!test_bit(B_SegRef, &b->flags)) {
+ struct block *p;
+ struct block *b2;
+ struct segsum *ss;
+ struct inode *ino;
+ int err;
BUG_ON(test_bit(B_Root, &b->flags));
}
}
spin_unlock(&ino->i_data.private_lock);
- /* b2 is the first ancestor without SegRef */
+ /* b2 is the first ancestor (closest to root) without SegRef */
/* FIXME we have an implicit reference on b2
* through b->parent...
* But if a split happens, b2 might not be a
* If it cannot, then we don't need the lock.
*/
- fs = fs_from_inode(b->inode);
ss = segsum_byaddr(fs, b2->physaddr, ssnum);
if (IS_ERR(ss)) {
putref(b, MKREF(segref));