diff options
author | Naohiro Aota <naohiro.aota@wdc.com> | 2023-08-08 01:12:39 +0900 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-08-21 14:52:19 +0200 |
commit | 5a7d107e5ef9b452cf0aa96ac931b29ea980d997 (patch) | |
tree | 94775880df47748865e074883d1158d971cf892a /fs/btrfs/space-info.c | |
parent | 6a8ebc773ef64c8f12d6d60fd6e53d5ccc81314b (diff) | |
download | linux-5a7d107e5ef9b452cf0aa96ac931b29ea980d997.tar.gz linux-5a7d107e5ef9b452cf0aa96ac931b29ea980d997.tar.bz2 linux-5a7d107e5ef9b452cf0aa96ac931b29ea980d997.zip |
btrfs: zoned: don't activate non-DATA BG on allocation
Now that a non-DATA block group is activated at write time, don't
activate it on allocation time.
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/space-info.c')
-rw-r--r-- | fs/btrfs/space-info.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/fs/btrfs/space-info.c b/fs/btrfs/space-info.c index 17c86db7b1b1..356638f54fef 100644 --- a/fs/btrfs/space-info.c +++ b/fs/btrfs/space-info.c @@ -761,18 +761,6 @@ static void flush_space(struct btrfs_fs_info *fs_info, break; case ALLOC_CHUNK: case ALLOC_CHUNK_FORCE: - /* - * For metadata space on zoned filesystem, reaching here means we - * don't have enough space left in active_total_bytes. Try to - * activate a block group first, because we may have inactive - * block group already allocated. - */ - ret = btrfs_zoned_activate_one_bg(fs_info, space_info, false); - if (ret < 0) - break; - else if (ret == 1) - break; - trans = btrfs_join_transaction(root); if (IS_ERR(trans)) { ret = PTR_ERR(trans); @@ -784,22 +772,6 @@ static void flush_space(struct btrfs_fs_info *fs_info, CHUNK_ALLOC_FORCE); btrfs_end_transaction(trans); - /* - * For metadata space on zoned filesystem, allocating a new chunk - * is not enough. We still need to activate the block * group. - * Active the newly allocated block group by (maybe) finishing - * a block group. - */ - if (ret == 1) { - ret = btrfs_zoned_activate_one_bg(fs_info, space_info, true); - /* - * Revert to the original ret regardless we could finish - * one block group or not. - */ - if (ret >= 0) - ret = 1; - } - if (ret > 0 || ret == -ENOSPC) ret = 0; break; |