From: NeilBrown Date: Mon, 21 Jun 2010 00:05:10 +0000 (+1000) Subject: Small tidy up for lafs_seg_ref_block X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=6f29185a4a05fa61b2be0aa219aadcea32fc6b23;p=LaFS.git Small tidy up for lafs_seg_ref_block Slight doco improvement, make local variables more local etc. Signed-off-by: NeilBrown --- diff --git a/segments.c b/segments.c index 4f393e9..10375fc 100644 --- a/segments.c +++ b/segments.c @@ -250,15 +250,16 @@ void lafs_seg_put_all(struct fs *fs) */ 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)); @@ -285,7 +286,7 @@ int lafs_seg_ref_block(struct block *b, int ssnum) } } 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 @@ -296,7 +297,6 @@ int lafs_seg_ref_block(struct block *b, int ssnum) * 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));