Commit 72cd8757 authored by Damien Le Moal's avatar Damien Le Moal Committed by Jens Axboe

block: Introduce BLKGETZONESZ ioctl

Get a zoned block device zone size in number of 512 B sectors.
The zone size is always 0 for regular block devices.
Reviewed-by: default avatarHannes Reinecke <hare@suse.com>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarDamien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2e85fbaf
...@@ -532,6 +532,8 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd, ...@@ -532,6 +532,8 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
return blkdev_report_zones_ioctl(bdev, mode, cmd, arg); return blkdev_report_zones_ioctl(bdev, mode, cmd, arg);
case BLKRESETZONE: case BLKRESETZONE:
return blkdev_reset_zones_ioctl(bdev, mode, cmd, arg); return blkdev_reset_zones_ioctl(bdev, mode, cmd, arg);
case BLKGETZONESZ:
return put_uint(arg, bdev_zone_sectors(bdev));
case HDIO_GETGEO: case HDIO_GETGEO:
return blkdev_getgeo(bdev, argp); return blkdev_getgeo(bdev, argp);
case BLKRAGET: case BLKRAGET:
......
...@@ -137,8 +137,10 @@ struct blk_zone_range { ...@@ -137,8 +137,10 @@ struct blk_zone_range {
* sector specified in the report request structure. * sector specified in the report request structure.
* @BLKRESETZONE: Reset the write pointer of the zones in the specified * @BLKRESETZONE: Reset the write pointer of the zones in the specified
* sector range. The sector range must be zone aligned. * sector range. The sector range must be zone aligned.
* @BLKGETZONESZ: Get the device zone size in number of 512 B sectors.
*/ */
#define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report) #define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report)
#define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range) #define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range)
#define BLKGETZONESZ _IOW(0x12, 132, __u32)
#endif /* _UAPI_BLKZONED_H */ #endif /* _UAPI_BLKZONED_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment