History

block: add capacity field to zone descriptors

In the zoned storage model, the sectors within a zone are typically all writeable. With the introduction of the Zoned Namespace (ZNS) Command Set in the NVM Express organization, the model was extended to have a specific writeable capacity. Extend the zone descriptor data structure with a zone capacity field to indicate to the user how many sectors in a zone are writeable. Introduce backward compatibility in the zone report ioctl by extending the zone report header data structure with a flags field to indicate if the capacity field is available.

Matias Bjørling committed 6 years ago

Commit 82394db1 parent f5af5774 files · +17 −2Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/blkzoned.h+13−2
@@ -73,6 +73,15 @@ enum blk_zone_cond { · 72 unmodified lines
7373 BLK_ZONE_COND_OFFLINE = 0xF,
7474 };
7575
76+/**
77+ * enum blk_zone_report_flags - Feature flags of reported zone descriptors.
78+ *
79+ * @BLK_ZONE_REP_CAPACITY: Zone descriptor has capacity field.
80+ */
81+enum blk_zone_report_flags {
82+ BLK_ZONE_REP_CAPACITY = (1 << 0),
83+};
84+
7685 /**
7786 * struct blk_zone - Zone descriptor for BLKREPORTZONE ioctl.
7887 *
@@ -99,7 +108,9 @@ struct blk_zone { · 20 unmodified lines
99108 __u8 cond; /* Zone condition */
100109 __u8 non_seq; /* Non-sequential write resources active */
101110 __u8 reset; /* Reset write pointer recommended */
102− __u8 reserved[36];
111+ __u8 resv[4];
112+ __u64 capacity; /* Zone capacity in number of sectors */
113+ __u8 reserved[24];
103114 };
104115
105116 /**
@@ -115,7 +126,7 @@ struct blk_zone { · 9 unmodified lines
115126 struct blk_zone_report {
116127 __u64 sector;
117128 __u32 nr_zones;
118− __u8 reserved[4];
129+ __u32 flags;
119130 struct blk_zone zones[0];
120131 };
121132