Commit 119e80df authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: call btrfs_create_pending_block_groups unconditionally

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: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent fa781cea
...@@ -3013,7 +3013,6 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans, ...@@ -3013,7 +3013,6 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
} }
if (run_all) { 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); spin_lock(&delayed_refs->lock);
......
...@@ -845,7 +845,6 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans, ...@@ -845,7 +845,6 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,
btrfs_trans_release_metadata(trans); btrfs_trans_release_metadata(trans);
trans->block_rsv = NULL; 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); btrfs_trans_release_chunk_metadata(trans);
...@@ -1943,7 +1942,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans) ...@@ -1943,7 +1942,6 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
cur_trans->delayed_refs.flushing = 1; cur_trans->delayed_refs.flushing = 1;
smp_wmb(); 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); ret = btrfs_run_delayed_refs(trans, 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment