]> git.neil.brown.name Git - LaFS.git/commitdiff
Small tidy up for lafs_seg_ref_block
authorNeilBrown <neilb@suse.de>
Mon, 21 Jun 2010 00:05:10 +0000 (10:05 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 21 Jun 2010 00:29:33 +0000 (10:29 +1000)
Slight doco improvement, make local variables more local etc.

Signed-off-by: NeilBrown <neilb@suse.de>
segments.c

index 4f393e98b634ce2ad535cdcb40bdf083761ae2f5..10375fc326cb635f8f88280c6b71ab21c8e964a5 100644 (file)
@@ -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));