btrfs-progs: zoned support DUP on metadata block groups

Support using BTRFS_BLOCK_GROUP_DUP on metadata (and system) block groups.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Johannes Thumshirn 2022-01-26 01:04:03 -08:00 committed by David Sterba
parent 88895a920f
commit f77da2b173
1 changed files with 9 additions and 3 deletions

View File

@ -808,14 +808,20 @@ out:
return ret;
}
bool zoned_profile_supported(u64 flags)
bool zoned_profile_supported(u64 map_type)
{
flags &= BTRFS_BLOCK_GROUP_PROFILE_MASK;
bool data = (map_type & BTRFS_BLOCK_GROUP_DATA);
u64 flags = (map_type & BTRFS_BLOCK_GROUP_PROFILE_MASK);
/* SINGLE */
if (flags == 0)
return true;
/* non-single profiles are not supported yet */
/* We can support DUP on metadata */
if (!data && (flags & BTRFS_BLOCK_GROUP_DUP))
return true;
/* All other profiles are not supported yet */
return false;
}