History

block: add zone open, close and finish ioctl support

Introduce three new ioctl commands BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE to allow applications to control the condition of zones on a zoned block device through the execution of the REQ_OP_ZONE_OPEN, REQ_OP_ZONE_CLOSE and REQ_OP_ZONE_FINISH operations. Contains contributions from Matias Bjorling, Hans Holmberg, Dmitry Fomichev, Keith Busch, Damien Le Moal and Christoph Hellwig.

Ajay Joshi committed 7 years ago

Commit e876df11 parent 6c1b1da4 files · +46 −14Browse files

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

Unified · Split

include/uapi/linux/blkzoned.h+14−3
@@ -120,9 +120,11 @@ struct blk_zone_report { · 119 unmodified lines
120120 };
121121
122122 /**
123− * struct blk_zone_range - BLKRESETZONE ioctl request
124− * @sector: starting sector of the first zone to issue reset write pointer
125− * @nr_sectors: Total number of sectors of 1 or more zones to reset
123+ * struct blk_zone_range - BLKRESETZONE/BLKOPENZONE/
124+ * BLKCLOSEZONE/BLKFINISHZONE ioctl
125+ * requests
126+ * @sector: Starting sector of the first zone to operate on.
127+ * @nr_sectors: Total number of sectors of all zones to operate on.
126128 */
127129 struct blk_zone_range {
128130 __u64 sector;
@@ -139,10 +141,19 @@ struct blk_zone_range { · 10 unmodified lines
139141 * sector range. The sector range must be zone aligned.
140142 * @BLKGETZONESZ: Get the device zone size in number of 512 B sectors.
141143 * @BLKGETNRZONES: Get the total number of zones of the device.
144+ * @BLKOPENZONE: Open the zones in the specified sector range.
145+ * The 512 B sector range must be zone aligned.
146+ * @BLKCLOSEZONE: Close the zones in the specified sector range.
147+ * The 512 B sector range must be zone aligned.
148+ * @BLKFINISHZONE: Mark the zones as full in the specified sector range.
149+ * The 512 B sector range must be zone aligned.
142150 */
143151 #define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report)
144152 #define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range)
145153 #define BLKGETZONESZ _IOR(0x12, 132, __u32)
146154 #define BLKGETNRZONES _IOR(0x12, 133, __u32)
155+#define BLKOPENZONE _IOW(0x12, 134, struct blk_zone_range)
156+#define BLKCLOSEZONE _IOW(0x12, 135, struct blk_zone_range)
157+#define BLKFINISHZONE _IOW(0x12, 136, struct blk_zone_range)
147158
148159 #endif /* _UAPI_BLKZONED_H */