From: Damien Le Moal <damien.lemoal@wdc.com>
To: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>,
dm-devel@redhat.com, Mike Snitzer <snitzer@redhat.com>
Cc: Christoph Hellwig <hch@lst.de>,
Matias Bjorling <matias.bjorling@wdc.com>
Subject: [PATCH v2 06/11] block: Introduce BLKGETZONESZ ioctl
Date: Thu, 11 Oct 2018 16:09:47 +0900 [thread overview]
Message-ID: <20181011070952.13248-7-damien.lemoal@wdc.com> (raw)
In-Reply-To: <20181011070952.13248-1-damien.lemoal@wdc.com>
Get a zoned block device zone size in number of 512 B sectors.
The zone size is always 0 for regular block devices.
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
---
block/ioctl.c | 2 ++
include/uapi/linux/blkzoned.h | 2 ++
2 files changed, 4 insertions(+)
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,
return blkdev_report_zones_ioctl(bdev, mode, cmd, arg);
case BLKRESETZONE:
return blkdev_reset_zones_ioctl(bdev, mode, cmd, arg);
+ case BLKGETZONESZ:
+ return put_uint(arg, bdev_zone_sectors(bdev));
case HDIO_GETGEO:
return blkdev_getgeo(bdev, argp);
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 {
* sector specified in the report request structure.
* @BLKRESETZONE: Reset the write pointer of the zones in the specified
* 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 BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range)
+#define BLKGETZONESZ _IOW(0x12, 132, __u32)
#endif /* _UAPI_BLKZONED_H */
--
2.17.1
next prev parent reply other threads:[~2018-10-11 7:09 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-11 7:09 [PATCH v2 00/11] Zoned block device support improvements Damien Le Moal
2018-10-11 7:09 ` [PATCH v2 01/11] scsi: sd_zbc: Rearrange code Damien Le Moal
2018-10-11 7:09 ` [PATCH v2 02/11] scsi: sd_zbc: Reduce boot device scan and revalidate time Damien Le Moal
2018-10-11 7:09 ` [PATCH v2 03/11] scsi: sd_zbc: Fix sd_zbc_check_zones() error checks Damien Le Moal
2018-10-11 7:09 ` [PATCH v2 04/11] block: Introduce blkdev_nr_zones() helper Damien Le Moal
2018-10-11 7:09 ` [PATCH v2 05/11] block: Limit allocation of zone descriptors for report zones Damien Le Moal
2018-10-11 7:09 ` Damien Le Moal [this message]
2018-10-11 7:09 ` [PATCH v2 07/11] block: Introduce BLKGETNRZONES ioctl Damien Le Moal
2018-10-11 7:09 ` [PATCH v2 08/11] block: Improve zone reset execution Damien Le Moal
2018-10-11 7:09 ` [PATCH v2 09/11] block: Expose queue nr_zones in sysfs Damien Le Moal
2018-10-11 14:42 ` Ewan D. Milne
2018-10-12 0:41 ` Damien Le Moal
2018-10-11 7:09 ` [PATCH v2 10/11] block: add a report_zones method Damien Le Moal
2018-10-11 7:09 ` [PATCH v2 11/11] block: Introduce blk_revalidate_disk_zones() Damien Le Moal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181011070952.13248-7-damien.lemoal@wdc.com \
--to=damien.lemoal@wdc.com \
--cc=axboe@kernel.dk \
--cc=dm-devel@redhat.com \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=matias.bjorling@wdc.com \
--cc=snitzer@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox