Skip to content

Commit d226b0a

Browse files
damien-lemoalmartinkpetersen
authored andcommitted
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]>
1 parent f79846c commit d226b0a

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/nvme/host/zns.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@
1010
int nvme_revalidate_zones(struct nvme_ns *ns)
1111
{
1212
struct request_queue *q = ns->queue;
13-
int ret;
1413

15-
ret = blk_revalidate_disk_zones(ns->disk, NULL);
16-
if (!ret)
17-
blk_queue_max_zone_append_sectors(q, ns->ctrl->max_zone_append);
18-
return ret;
14+
blk_queue_chunk_sectors(q, ns->zsze);
15+
blk_queue_max_zone_append_sectors(q, ns->ctrl->max_zone_append);
16+
17+
return blk_revalidate_disk_zones(ns->disk, NULL);
1918
}
2019

2120
static int nvme_set_max_append(struct nvme_ctrl *ctrl)

0 commit comments

Comments
 (0)