aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@wdc.com>2018-10-12 06:08:45 -0400
committerJens Axboe <axboe@kernel.dk>2018-10-25 13:17:40 -0400
commit72cd87576d1d885fc2968416ed5aca8f54749653 (patch)
treec965a7ffee387262de03c108c6fecc837e5b98bb
parent2e85fbaff3a71e46038ec736186c42ffa721c775 (diff)
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: Hannes Reinecke <hare@suse.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/ioctl.c2
-rw-r--r--include/uapi/linux/blkzoned.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/block/ioctl.c b/block/ioctl.c
index 3884d810efd2..f6d2c6f1f050 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -532,6 +532,8 @@ int blkdev_ioctl(struct block_device *bdev, fmode_t mode, unsigned cmd,
532 return blkdev_report_zones_ioctl(bdev, mode, cmd, arg); 532 return blkdev_report_zones_ioctl(bdev, mode, cmd, arg);
533 case BLKRESETZONE: 533 case BLKRESETZONE:
534 return blkdev_reset_zones_ioctl(bdev, mode, cmd, arg); 534 return blkdev_reset_zones_ioctl(bdev, mode, cmd, arg);
535 case BLKGETZONESZ:
536 return put_uint(arg, bdev_zone_sectors(bdev));
535 case HDIO_GETGEO: 537 case HDIO_GETGEO:
536 return blkdev_getgeo(bdev, argp); 538 return blkdev_getgeo(bdev, argp);
537 case BLKRAGET: 539 case BLKRAGET:
diff --git a/include/uapi/linux/blkzoned.h b/include/uapi/linux/blkzoned.h
index ff5a5db8906a..281ac605f752 100644
--- a/include/uapi/linux/blkzoned.h
+++ b/include/uapi/linux/blkzoned.h
@@ -137,8 +137,10 @@ struct blk_zone_range {
137 * sector specified in the report request structure. 137 * sector specified in the report request structure.
138 * @BLKRESETZONE: Reset the write pointer of the zones in the specified 138 * @BLKRESETZONE: Reset the write pointer of the zones in the specified
139 * sector range. The sector range must be zone aligned. 139 * sector range. The sector range must be zone aligned.
140 * @BLKGETZONESZ: Get the device zone size in number of 512 B sectors.
140 */ 141 */
141#define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report) 142#define BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report)
142#define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range) 143#define BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range)
144#define BLKGETZONESZ _IOW(0x12, 132, __u32)
143 145
144#endif /* _UAPI_BLKZONED_H */ 146#endif /* _UAPI_BLKZONED_H */