diff options
author | Naohiro Aota <naohiro.aota@wdc.com> | 2022-05-04 03:48:50 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-05-16 18:17:32 +0300 |
commit | 1bfd476754a2d63f899ef9c3e253b17766b8fb73 (patch) | |
tree | 524eb7511c8709caf291088f41837a28a96e2bf7 /fs/btrfs/extent-tree.c | |
parent | cf4f03c3be4a2a08be5d3a40d25ef577be2db061 (diff) | |
download | linux-1bfd476754a2d63f899ef9c3e253b17766b8fb73.tar.xz |
btrfs: zoned: introduce btrfs_zoned_bg_is_full
Introduce a wrapper to check if all the space in a block group is
allocated or not.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 8ef4aa5a46d6..fb367689d9d2 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -3800,8 +3800,7 @@ static int do_allocation_zoned(struct btrfs_block_group *block_group, /* Check RO and no space case before trying to activate it */ spin_lock(&block_group->lock); - if (block_group->ro || - block_group->alloc_offset == block_group->zone_capacity) { + if (block_group->ro || btrfs_zoned_bg_is_full(block_group)) { ret = 1; /* * May need to clear fs_info->{treelog,data_reloc}_bg. |