Skip to content

Commit 2d81eb1

Browse files
morbidrsakdave
authored andcommitted
btrfs: zoned: let the for_treelog test in the allocator stand out
The statement which decides if an extent allocation on a zoned device is for the dedicated tree-log block group or not and if we can use the block group we picked for this allocation is not easy to read but an important part of the allocator. Rewrite into an if condition instead of a plain boolean test to make it stand out more, like the version which tests for the dedicated data-relocation block group. Signed-off-by: Johannes Thumshirn <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 4b01c44 commit 2d81eb1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

fs/btrfs/extent-tree.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3763,7 +3763,7 @@ static int do_allocation_zoned(struct btrfs_block_group *block_group,
37633763
u64 log_bytenr;
37643764
u64 data_reloc_bytenr;
37653765
int ret = 0;
3766-
bool skip;
3766+
bool skip = false;
37673767

37683768
ASSERT(btrfs_is_zoned(block_group->fs_info));
37693769

@@ -3773,8 +3773,9 @@ static int do_allocation_zoned(struct btrfs_block_group *block_group,
37733773
*/
37743774
spin_lock(&fs_info->treelog_bg_lock);
37753775
log_bytenr = fs_info->treelog_bg;
3776-
skip = log_bytenr && ((ffe_ctl->for_treelog && bytenr != log_bytenr) ||
3777-
(!ffe_ctl->for_treelog && bytenr == log_bytenr));
3776+
if (log_bytenr && ((ffe_ctl->for_treelog && bytenr != log_bytenr) ||
3777+
(!ffe_ctl->for_treelog && bytenr == log_bytenr)))
3778+
skip = true;
37783779
spin_unlock(&fs_info->treelog_bg_lock);
37793780
if (skip)
37803781
return 1;

0 commit comments

Comments
 (0)