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.
Showing the changes to include/uapi/linux (1 of 4 files). Show all
Unified · Split
| @@ -120,9 +120,11 @@ struct blk_zone_report { · 119 unmodified lines | ||
| 120 | 120 | }; |
| 121 | 121 | |
| 122 | 122 | /** |
| 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. | |
| 126 | 128 | */ |
| 127 | 129 | struct blk_zone_range { |
| 128 | 130 | __u64 sector; |
| @@ -139,10 +141,19 @@ struct blk_zone_range { · 10 unmodified lines | ||
| 139 | 141 | * sector range. The sector range must be zone aligned. |
| 140 | 142 | * @BLKGETZONESZ: Get the device zone size in number of 512 B sectors. |
| 141 | 143 | * @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. | |
| 142 | 150 | */ |
| 143 | 151 | #define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report) |
| 144 | 152 | #define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range) |
| 145 | 153 | #define BLKGETZONESZ _IOR(0x12, 132, __u32) |
| 146 | 154 | #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) | |
| 147 | 158 | |
| 148 | 159 | #endif /* _UAPI_BLKZONED_H */ |