Btrfs: don't run delayed nodes again after all nodes flush
authorMiao Xie <miaox@cn.fujitsu.com>
Thu, 26 Dec 2013 05:07:02 +0000 (13:07 +0800)
committerChris Mason <clm@fb.com>
Tue, 28 Jan 2014 21:20:06 +0000 (13:20 -0800)
If the number of the delayed items is greater than the upper limit, we will
try to flush all the delayed items. After that, it is unnecessary to run
them again because they are being dealt with by the wokers or the number of
them is less than the lower limit.

Signed-off-by: Miao Xie <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
fs/btrfs/delayed-inode.c

index 608efeb24aea68b97ce27a1431a005b2a3565a0e..10d149c1fde186f7d859622ef98bbf6bf4feef9a 100644 (file)
@@ -1395,6 +1395,7 @@ void btrfs_balance_delayed_items(struct btrfs_root *root)
                                break;
                }
                finish_wait(&delayed_root->wait, &__wait);
+               return;
        }
 
        btrfs_wq_run_delayed_node(delayed_root, root, BTRFS_DELAYED_BATCH);