diff mbox series

btrfs-progs: pass in block-group type to zoned_profile_supported

Message ID 20220209154218.181569-1-johannes.thumshirn@wdc.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: pass in block-group type to zoned_profile_supported | expand

Commit Message

Johannes Thumshirn Feb. 9, 2022, 3:42 p.m. UTC
Pass BTRFS_BLOCK_GROUP_DATA and BTRFS_BLOCK_GROUP_METADATA to
zoned_profile_supported(), so we can actually distinguish if it is a data
or a meta-data block group.

Fixes: 8f914d518a46 ("btrfs-progs: zoned support DUP on metadata block groups")
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 kernel-shared/zoned.h | 2 +-
 mkfs/main.c           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

David Sterba Feb. 9, 2022, 5:12 p.m. UTC | #1
On Wed, Feb 09, 2022 at 07:42:18AM -0800, Johannes Thumshirn wrote:
> Pass BTRFS_BLOCK_GROUP_DATA and BTRFS_BLOCK_GROUP_METADATA to
> zoned_profile_supported(), so we can actually distinguish if it is a data
> or a meta-data block group.
> 
> Fixes: 8f914d518a46 ("btrfs-progs: zoned support DUP on metadata block groups")
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Thanks. Meanwhile there was a reported bug with --disable-zoned that was
missing the definition. It's been fixed in devel, so please check that
patches also builds with zoned both enabled and disabled.
diff mbox series

Patch

diff --git a/kernel-shared/zoned.h b/kernel-shared/zoned.h
index ebd6dc34c619..db7567d02742 100644
--- a/kernel-shared/zoned.h
+++ b/kernel-shared/zoned.h
@@ -118,7 +118,7 @@  static inline bool btrfs_dev_is_empty_zone(struct btrfs_device *device, u64 pos)
 	return zinfo->zones[zno].cond == BLK_ZONE_COND_EMPTY;
 }
 
-bool zoned_profile_supported(u64 flags);
+bool zoned_profile_supported(u64 map_type);
 int btrfs_reset_dev_zone(int fd, struct blk_zone *zone);
 u64 btrfs_find_allocatable_zones(struct btrfs_device *device, u64 hole_start,
 				 u64 hole_end, u64 num_bytes);
diff --git a/mkfs/main.c b/mkfs/main.c
index e6c4eb1f9b93..f9e8be748c5a 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -1349,8 +1349,8 @@  int BOX_MAIN(mkfs)(int argc, char **argv)
 	if (ret)
 		goto error;
 
-	if (zoned && (!zoned_profile_supported(metadata_profile) ||
-		      !zoned_profile_supported(data_profile))) {
+	if (zoned && (!zoned_profile_supported(BTRFS_BLOCK_GROUP_METADATA | metadata_profile) ||
+		      !zoned_profile_supported(BTRFS_BLOCK_GROUP_DATA | data_profile))) {
 		error("zoned mode does not yet support RAID/DUP profiles, please specify '-d single -m single' manually");
 		goto error;
 	}