aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Le Moal <[email protected]>2023-07-03 11:48:09 +0900
committerMartin K. Petersen <[email protected]>2023-07-05 21:58:10 -0400
commitd226b0a2b683e27fce060669dc7cb8d6917b785a (patch)
treead4b7e08cee9901008cc5d686a8d728abf05c2a9
parentf79846ca2f04c9744627c24034d675c88f0da3a0 (diff)
scsi: nvme: zns: Set zone limits before revalidating zones
In nvme_revalidate_zones(), execute blk_queue_chunk_sectors() and blk_queue_max_zone_append_sectors() to respectively set a ZNS namespace zone size and maximum zone append sector limit before executing blk_revalidate_disk_zones(). This is to allow the block layer zone reavlidation to check these device characteristics prior to checking all zones of the device. Signed-off-by: Damien Le Moal <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Bart Van Assche <[email protected]> Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
-rw-r--r--drivers/nvme/host/zns.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c
index 12316ab51bda..ec8557810c21 100644
--- a/drivers/nvme/host/zns.c
+++ b/drivers/nvme/host/zns.c
@@ -10,12 +10,11 @@
int nvme_revalidate_zones(struct nvme_ns *ns)
{
struct request_queue *q = ns->queue;
- int ret;
- ret = blk_revalidate_disk_zones(ns->disk, NULL);
- if (!ret)
- blk_queue_max_zone_append_sectors(q, ns->ctrl->max_zone_append);
- return ret;
+ blk_queue_chunk_sectors(q, ns->zsze);
+ blk_queue_max_zone_append_sectors(q, ns->ctrl->max_zone_append);
+
+ return blk_revalidate_disk_zones(ns->disk, NULL);
}
static int nvme_set_max_append(struct nvme_ctrl *ctrl)