Skip to content

Commit 7b3d5a9

Browse files
naotakdave
authored andcommitted
btrfs: introduce ZONED feature flag
This patch introduces the ZONED incompat flag. The flag indicates that the volume management will satisfy the constraints imposed by host-managed zoned block devices (aligned chunk allocation, append-only updates, reset zone after filled). As the zoned support will happen incrementally due to enhancing some core infrastructure like super block writes, tree-log, raid support, the feature will appear in sysfs only on debug builds. It will be enabled once the support is feature complete and applications can reliably check whether zoned support is present or not. Reviewed-by: Anand Jain <anand.jain@oracle.com> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent a2633b6 commit 7b3d5a9

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎fs/btrfs/sysfs.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,10 @@ BTRFS_FEAT_ATTR_INCOMPAT(no_holes, NO_HOLES);
263263
BTRFS_FEAT_ATTR_INCOMPAT(metadata_uuid, METADATA_UUID);
264264
BTRFS_FEAT_ATTR_COMPAT_RO(free_space_tree, FREE_SPACE_TREE);
265265
BTRFS_FEAT_ATTR_INCOMPAT(raid1c34, RAID1C34);
266+
/* Remove once support for zoned allocation is feature complete */
267+
#ifdef CONFIG_BTRFS_DEBUG
268+
BTRFS_FEAT_ATTR_INCOMPAT(zoned, ZONED);
269+
#endif
266270

267271
static struct attribute *btrfs_supported_feature_attrs[] = {
268272
BTRFS_FEAT_ATTR_PTR(mixed_backref),
@@ -278,6 +282,9 @@ static struct attribute *btrfs_supported_feature_attrs[] = {
278282
BTRFS_FEAT_ATTR_PTR(metadata_uuid),
279283
BTRFS_FEAT_ATTR_PTR(free_space_tree),
280284
BTRFS_FEAT_ATTR_PTR(raid1c34),
285+
#ifdef CONFIG_BTRFS_DEBUG
286+
BTRFS_FEAT_ATTR_PTR(zoned),
287+
#endif
281288
NULL
282289
};
283290

‎include/uapi/linux/btrfs.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ struct btrfs_ioctl_fs_info_args {
307307
#define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9)
308308
#define BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10)
309309
#define BTRFS_FEATURE_INCOMPAT_RAID1C34 (1ULL << 11)
310+
#define BTRFS_FEATURE_INCOMPAT_ZONED (1ULL << 12)
310311

311312
struct btrfs_ioctl_feature_flags {
312313
__u64 compat_flags;

0 commit comments

Comments
 (0)