diff options
author | Christoph Hellwig <hch@lst.de> | 2021-05-19 09:17:06 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2021-06-03 09:29:26 +0200 |
commit | 8b4fb0f968ffe73f619c06cb4040ecaa60327098 (patch) | |
tree | bc7d69a9c0d0f49645e059d2e41af54d88e79ea1 /drivers/nvme/host/zns.c | |
parent | nvme: move the CSI sanity check into nvme_ns_report_zones (diff) | |
download | linux-8b4fb0f968ffe73f619c06cb4040ecaa60327098.tar.xz linux-8b4fb0f968ffe73f619c06cb4040ecaa60327098.zip |
nvme: split nvme_report_zones
Split multipath support out of nvme_report_zones into a separate helper
and simplify the non-multipath version as a result.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Diffstat (limited to 'drivers/nvme/host/zns.c')
-rw-r--r-- | drivers/nvme/host/zns.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/drivers/nvme/host/zns.c b/drivers/nvme/host/zns.c index 31e789ecd940..d95010481fce 100644 --- a/drivers/nvme/host/zns.c +++ b/drivers/nvme/host/zns.c @@ -171,8 +171,8 @@ static int nvme_zone_parse_entry(struct nvme_ns *ns, return cb(&zone, idx, data); } -static int nvme_ns_report_zones(struct nvme_ns *ns, sector_t sector, - unsigned int nr_zones, report_zones_cb cb, void *data) +int nvme_ns_report_zones(struct nvme_ns *ns, sector_t sector, + unsigned int nr_zones, report_zones_cb cb, void *data) { struct nvme_zone_report *report; struct nvme_command c = { }; @@ -230,22 +230,6 @@ out_free: return ret; } -int nvme_report_zones(struct gendisk *disk, sector_t sector, - unsigned int nr_zones, report_zones_cb cb, void *data) -{ - struct nvme_ns_head *head = NULL; - struct nvme_ns *ns; - int srcu_idx, ret; - - ns = nvme_get_ns_from_disk(disk, &head, &srcu_idx); - if (unlikely(!ns)) - return -EWOULDBLOCK; - ret = nvme_ns_report_zones(ns, sector, nr_zones, cb, data); - nvme_put_ns_from_disk(head, srcu_idx); - - return ret; -} - blk_status_t nvme_setup_zone_mgmt_send(struct nvme_ns *ns, struct request *req, struct nvme_command *c, enum nvme_zone_mgmt_action action) { |