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 <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>
This commit is contained in:
Christoph Hellwig 2020-09-28 10:25:54 +02:00
parent eba9bcf7fe
commit 2124f096fb

View File

@ -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);