Skip to content

Commit 119e80d

Browse files
josefbacikkdave
authored andcommitted
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: Nikolay Borisov <[email protected]> Signed-off-by: Josef Bacik <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent fa781ce commit 119e80d

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

fs/btrfs/extent-tree.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3013,8 +3013,7 @@ int btrfs_run_delayed_refs(struct btrfs_trans_handle *trans,
30133013
}
30143014

30153015
if (run_all) {
3016-
if (!list_empty(&trans->new_bgs))
3017-
btrfs_create_pending_block_groups(trans);
3016+
btrfs_create_pending_block_groups(trans);
30183017

30193018
spin_lock(&delayed_refs->lock);
30203019
node = rb_first_cached(&delayed_refs->href_root);

fs/btrfs/transaction.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -845,8 +845,7 @@ static int __btrfs_end_transaction(struct btrfs_trans_handle *trans,
845845
btrfs_trans_release_metadata(trans);
846846
trans->block_rsv = NULL;
847847

848-
if (!list_empty(&trans->new_bgs))
849-
btrfs_create_pending_block_groups(trans);
848+
btrfs_create_pending_block_groups(trans);
850849

851850
btrfs_trans_release_chunk_metadata(trans);
852851

@@ -1943,8 +1942,7 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans)
19431942
cur_trans->delayed_refs.flushing = 1;
19441943
smp_wmb();
19451944

1946-
if (!list_empty(&trans->new_bgs))
1947-
btrfs_create_pending_block_groups(trans);
1945+
btrfs_create_pending_block_groups(trans);
19481946

19491947
ret = btrfs_run_delayed_refs(trans, 0);
19501948
if (ret) {

0 commit comments

Comments
 (0)