From: Christoph Hellwig <hch@lst.de>
Date: Thu, 20 Aug 2020 14:02:18 +0200
Subject: nvme: remove the disk argument to nvme_update_zone_info
Patch-mainline: v5.10-rc1
Git-commit: d525c3c023221619748d1e758e5a26daa775f822
References: bsc#1180197
The queue can trivially be derived from the nvme_ns structure.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
Acked-by: Daniel Wagner <dwagner@suse.de>
---
drivers/nvme/host/core.c | 2 +-
drivers/nvme/host/nvme.h | 8 ++------
drivers/nvme/host/zns.c | 5 ++---
3 files changed, 5 insertions(+), 10 deletions(-)
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2095,7 +2095,7 @@ static int __nvme_revalidate_disk(struct
case NVME_CSI_NVM:
break;
case NVME_CSI_ZNS:
- ret = nvme_update_zone_info(disk, ns, lbaf);
+ ret = nvme_update_zone_info(ns, lbaf);
if (ret) {
dev_warn(ctrl->device,
"failed to add zoned namespace:%u ret:%d\n",
--- a/drivers/nvme/host/nvme.h
+++ b/drivers/nvme/host/nvme.h
@@ -760,9 +760,7 @@ static inline void nvme_mpath_start_free
int nvme_revalidate_zones(struct nvme_ns *ns);
#ifdef CONFIG_BLK_DEV_ZONED
-int nvme_update_zone_info(struct gendisk *disk, struct nvme_ns *ns,
- unsigned lbaf);
-
+int nvme_update_zone_info(struct nvme_ns *ns, unsigned lbaf);
int nvme_report_zones(struct gendisk *disk, sector_t sector,
unsigned int nr_zones, report_zones_cb cb, void *data);
@@ -779,9 +777,7 @@ static inline blk_status_t nvme_setup_zo
return BLK_STS_NOTSUPP;
}
-static inline int nvme_update_zone_info(struct gendisk *disk,
- struct nvme_ns *ns,
- unsigned lbaf)
+static inline int nvme_update_zone_info(struct nvme_ns *ns, unsigned lbaf)
{
dev_warn(ns->ctrl->device,
"Please enable CONFIG_BLK_DEV_ZONED to support ZNS devices\n");
--- a/drivers/nvme/host/zns.c
+++ b/drivers/nvme/host/zns.c
@@ -46,11 +46,10 @@ static int nvme_set_max_append(struct nv
return 0;
}
-int nvme_update_zone_info(struct gendisk *disk, struct nvme_ns *ns,
- unsigned lbaf)
+int nvme_update_zone_info(struct nvme_ns *ns, unsigned lbaf)
{
struct nvme_effects_log *log = ns->head->effects;
- struct request_queue *q = disk->queue;
+ struct request_queue *q = ns->queue;
struct nvme_command c = { };
struct nvme_id_ns_zns *id;
int status;