diff mbox series

[2/2] btrfs-progs: zoned support DUP on metadata block groups

Message ID 20220126090403.57672-3-johannes.thumshirn@wdc.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: support DUP on metadata for zoned | expand

Commit Message

Johannes Thumshirn Jan. 26, 2022, 9:04 a.m. UTC
Support using BTRFS_BLOCK_GROUP_DUP on metadata (and system) block groups.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 kernel-shared/zoned.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/kernel-shared/zoned.c b/kernel-shared/zoned.c
index e6fd4b31b9d6..f9f55626115e 100644
--- a/kernel-shared/zoned.c
+++ b/kernel-shared/zoned.c
@@ -808,14 +808,20 @@  out:
 	return ret;
 }
 
-bool profile_supported(u64 flags)
+bool 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 meta-data */
+	if (!data && (flags & BTRFS_BLOCK_GROUP_DUP))
+		return true;
+
+	/* All other profiles are not supported yet */
 	return false;
 }