OSDN Git Service

btrfs: call btrfs_create_pending_block_groups unconditionally
authorJosef Bacik <josef@toxicpanda.com>
Wed, 21 Nov 2018 19:05:42 +0000 (14:05 -0500)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 Feb 2019 13:13:25 +0000 (14:13 +0100)
The first thing we do is loop through the list, this

if (!list_empty())
btrfs_create_pending_block_groups();

thing is just wasted space.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c
fs/btrfs/transaction.c

index 0225659..1b35a23 100644 (file)
@@ -3013,8 +3013,7 @@ again:
        }
 
        if (run_all) {
-               if (!list_empty(&trans->new_bgs))
-                       btrfs_create_pending_block_groups(trans);
+               btrfs_create_pending_block_groups(trans);
 
                spin_lock(&delayed_refs->lock);
                node = rb_first_cached(&delayed_refs->href_root);
index 4ec2b66..fdffe5d 100644 (file)
@@ -845,8 +845,7 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,
        btrfs_trans_release_metadata(trans);
        trans->block_rsv = NULL;
 
-       if (!list_empty(&trans->new_bgs))
-               btrfs_create_pending_block_groups(trans);
+       btrfs_create_pending_block_groups(trans);
 
        btrfs_trans_release_chunk_metadata(trans);
 
@@ -1943,8 +1942,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
        cur_trans->delayed_refs.flushing = 1;
        smp_wmb();
 
-       if (!list_empty(&trans->new_bgs))
-               btrfs_create_pending_block_groups(trans);
+       btrfs_create_pending_block_groups(trans);
 
        ret = btrfs_run_delayed_refs(trans, 0);
        if (ret) {