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.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -73,6 +73,15 @@ enum blk_zone_cond { · 72 unmodified lines | ||
| 73 | 73 | BLK_ZONE_COND_OFFLINE = 0xF, |
| 74 | 74 | }; |
| 75 | 75 | |
| 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 | + | |
| 76 | 85 | /** |
| 77 | 86 | * struct blk_zone - Zone descriptor for BLKREPORTZONE ioctl. |
| 78 | 87 | * |
| @@ -99,7 +108,9 @@ struct blk_zone { · 20 unmodified lines | ||
| 99 | 108 | __u8 cond; /* Zone condition */ |
| 100 | 109 | __u8 non_seq; /* Non-sequential write resources active */ |
| 101 | 110 | __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]; | |
| 103 | 114 | }; |
| 104 | 115 | |
| 105 | 116 | /** |
| @@ -115,7 +126,7 @@ struct blk_zone { · 9 unmodified lines | ||
| 115 | 126 | struct blk_zone_report { |
| 116 | 127 | __u64 sector; |
| 117 | 128 | __u32 nr_zones; |
| 118 | − __u8 reserved[4]; | |
| 129 | + __u32 flags; | |
| 119 | 130 | struct blk_zone zones[0]; |
| 120 | 131 | }; |
| 121 | 132 | |