From f77da2b1738cf9f1aaea2f5fbd473a193dea10d7 Mon Sep 17 00:00:00 2001 From: Johannes Thumshirn Date: Wed, 26 Jan 2022 01:04:03 -0800 Subject: [PATCH] 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 Signed-off-by: David Sterba --- kernel-shared/zoned.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/kernel-shared/zoned.c b/kernel-shared/zoned.c index f5ece7c8..2a11a1d7 100644 --- a/kernel-shared/zoned.c +++ b/kernel-shared/zoned.c @@ -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; }