From 1cb71862983e25e6843f5bf92d288679ef2c84bf Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Mon, 13 Sep 2010 18:15:46 +1000 Subject: [PATCH] tidy lafs_get_flushable a bit. 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 --- checkpoint.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/checkpoint.c b/checkpoint.c index 9062455..32ab345 100644 --- a/checkpoint.c +++ b/checkpoint.c @@ -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; } -- 2.39.5