summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorMatias Bjørling <matias.bjorling@wdc.com>2020-06-29 22:06:37 +0300
committerChristoph Hellwig <hch@lst.de>2020-07-08 17:16:19 +0300
commit82394db7383d33641f3f565bd79792fb41b1741f (patch)
treea7cd00ad8a1ed5588578ac4c6894fe2c582c5327 /block
parentf5af577d553103115579b5e404070dfab4d00332 (diff)
downloadlinux-82394db7383d33641f3f565bd79792fb41b1741f.tar.xz
block: add capacity field to zone descriptors
In the zoned storage model, the sectors within a zone are typically all writeable. With the introduction of the Zoned Namespace (ZNS) Command Set in the NVM Express organization, the model was extended to have a specific writeable capacity. Extend the zone descriptor data structure with a zone capacity field to indicate to the user how many sectors in a zone are writeable. Introduce backward compatibility in the zone report ioctl by extending the zone report header data structure with a flags field to indicate if the capacity field is available. Reviewed-by: Jens Axboe <axboe@kernel.dk> Reviewed-by: Javier González <javier.gonz@samsung.com> Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: Daniel Wagner <dwagner@suse.de> Signed-off-by: Matias Bjørling <matias.bjorling@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'block')
-rw-r--r--block/blk-zoned.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/block/blk-zoned.c b/block/blk-zoned.c
index 23831fa8701d..81152a260354 100644
--- a/block/blk-zoned.c
+++ b/block/blk-zoned.c
@@ -312,6 +312,7 @@ int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode,
return ret;
rep.nr_zones = ret;
+ rep.flags = BLK_ZONE_REP_CAPACITY;
if (copy_to_user(argp, &rep, sizeof(struct blk_zone_report)))
return -EFAULT;
return 0;