]> git.neil.brown.name Git - LaFS.git/commitdiff
tidy lafs_get_flushable a bit.
authorNeilBrown <neilb@suse.de>
Mon, 13 Sep 2010 08:15:46 +0000 (18:15 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 13 Sep 2010 08:15:46 +0000 (18:15 +1000)
There is some code in the wrong place - probably a hang over from a
previous arrangement before we made lafs_is_leaf a function.
No function change here.

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

index 90624551ee6f47e8a9869b40e902d7c9fa190b0e..32ab3452d49960e675450ef3fd089ff7e118135c 100644 (file)
@@ -332,10 +332,6 @@ struct block *lafs_get_flushable(struct fs *fs, int phase)
        struct block *b = NULL;
 
 retry:
-       if (b) {
-               lafs_iounlock_block(b);
-               putref(b, MKREF(leaf));
-       }
        spin_lock(&fs->lock);
        if (!list_empty(&fs->clean_leafs))
                b = list_entry(fs->clean_leafs.next, struct block, lru);
@@ -356,8 +352,11 @@ retry:
         */
        lafs_iolock_block(b);
 
-       if (!lafs_is_leaf(b, phase))
+       if (!lafs_is_leaf(b, phase)) {
+               lafs_iounlock_block(b);
+               putref(b, MKREF(leaf));
                goto retry;
+       }
 
        return b;
 }