From 2124f096fb4521d8efdf2412e9102d475ff5cd36 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 28 Sep 2020 10:25:54 +0200 Subject: nvme: rename _nvme_revalidate_disk Rename _nvme_revalidate_disk to nvme_validate_ns to better describe what the function does, and pass the struct nvme_ns instead of the gendisk to better match the call chain. Signed-off-by: Christoph Hellwig Reviewed-by: Keith Busch Reviewed-by: Sagi Grimberg Reviewed-by: Chaitanya Kulkarni Reviewed-by: Damien Le Moal --- drivers/nvme/host/core.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'drivers/nvme') diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index c5f2615bf583..c04043a94e64 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -89,7 +89,7 @@ static dev_t nvme_chr_devt; static struct class *nvme_class; static struct class *nvme_subsys_class; -static int _nvme_revalidate_disk(struct gendisk *disk); +static int nvme_validate_ns(struct nvme_ns *ns); static void nvme_put_subsystem(struct nvme_subsystem *subsys); static void nvme_remove_invalid_namespaces(struct nvme_ctrl *ctrl, unsigned nsid); @@ -1026,7 +1026,7 @@ static void nvme_update_formats(struct nvme_ctrl *ctrl, u32 *effects) down_read(&ctrl->namespaces_rwsem); list_for_each_entry(ns, &ctrl->namespaces, list) - if (_nvme_revalidate_disk(ns->disk)) + if (nvme_validate_ns(ns)) nvme_set_queue_dying(ns); else if (blk_queue_is_zoned(ns->disk->queue)) { /* @@ -2154,16 +2154,15 @@ static int __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id) return 0; } -static int _nvme_revalidate_disk(struct gendisk *disk) +static int nvme_validate_ns(struct nvme_ns *ns) { - struct nvme_ns *ns = disk->private_data; struct nvme_ctrl *ctrl = ns->ctrl; struct nvme_id_ns *id; struct nvme_ns_ids ids; int ret = 0; if (test_bit(NVME_NS_DEAD, &ns->flags)) { - set_capacity(disk, 0); + set_capacity(ns->disk, 0); return -ENODEV; } @@ -2187,7 +2186,7 @@ static int _nvme_revalidate_disk(struct gendisk *disk) goto free_id; } - ret = __nvme_revalidate_disk(disk, id); + ret = __nvme_revalidate_disk(ns->disk, id); free_id: kfree(id); out: @@ -4032,7 +4031,7 @@ static void nvme_validate_or_alloc_ns(struct nvme_ctrl *ctrl, unsigned nsid) return; } - ret = _nvme_revalidate_disk(ns->disk); + ret = nvme_validate_ns(ns); if (!ret && blk_queue_is_zoned(ns->queue)) ret = nvme_revalidate_zones(ns); revalidate_disk_size(ns->disk, ret == 0); -- cgit v1.2.3