From: Damien Le Moal <dlemoal@kernel.org>
To: linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
linux-nvme@lists.infradead.org, Christoph Hellwig <hch@lst.de>,
Keith Busch <kbusch@kernel.org>,
linux-scsi@vger.kernel.org,
"Martin K . Petersen" <martin.petersen@oracle.com>
Subject: [PATCH v3 2/5] nvme: zns: Set zone limits before revalidating zones
Date: Mon, 3 Jul 2023 11:48:09 +0900 [thread overview]
Message-ID: <20230703024812.76778-3-dlemoal@kernel.org> (raw)
In-Reply-To: <20230703024812.76778-1-dlemoal@kernel.org>
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 <dlemoal@kernel.org>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/nvme/host/zns.c | 9 ++++-----
1 file 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)
--
2.41.0
next prev parent reply other threads:[~2023-07-03 2:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-03 2:48 [PATCH v3 0/5] Improve checks in blk_revalidate_disk_zones() Damien Le Moal
2023-07-03 2:48 ` [PATCH v3 1/5] scsi: sd_zbc: Set zone limits before revalidating zones Damien Le Moal
2023-07-03 7:23 ` Johannes Thumshirn
2023-07-03 2:48 ` Damien Le Moal [this message]
2023-07-03 7:23 ` [PATCH v3 2/5] nvme: zns: " Johannes Thumshirn
2023-07-03 2:48 ` [PATCH v3 3/5] block: nullblk: " Damien Le Moal
2023-07-03 7:24 ` Johannes Thumshirn
2023-07-03 2:48 ` [PATCH v3 4/5] block: virtio_blk: " Damien Le Moal
2023-07-03 7:24 ` Johannes Thumshirn
2023-07-03 2:48 ` [PATCH v3 5/5] block: improve checks in blk_revalidate_disk_zones() Damien Le Moal
2023-07-03 7:26 ` Johannes Thumshirn
2023-07-06 2:04 ` [PATCH v3 0/5] Improve " Martin K. Petersen
2023-07-11 16:31 ` Martin K. Petersen
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=20230703024812.76778-3-dlemoal@kernel.org \
--to=dlemoal@kernel.org \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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