Skip to content

Commit 9e221d8

Browse files
shroffniChristoph Hellwig
authored andcommitted
nvme: rename nvme_mpath_shutdown_disk to nvme_mpath_remove_disk
In the NVMe context, the term "shutdown" has a specific technical meaning. To avoid confusion, this commit renames the nvme_mpath_ shutdown_disk function to nvme_mpath_remove_disk to better reflect its purpose (i.e. removing the disk from the system). However, nvme_mpath_remove_disk was already in use, and its functionality is related to releasing or putting the head node disk. To resolve this naming conflict and improve clarity, the existing nvme_mpath_ remove_disk function is also renamed to nvme_mpath_put_disk. This renaming improves code readability and better aligns function names with their actual roles. Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Signed-off-by: Nilay Shroff <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 737af5f commit 9e221d8

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

drivers/nvme/host/core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ static void nvme_free_ns_head(struct kref *ref)
668668
struct nvme_ns_head *head =
669669
container_of(ref, struct nvme_ns_head, ref);
670670

671-
nvme_mpath_remove_disk(head);
671+
nvme_mpath_put_disk(head);
672672
ida_free(&head->subsys->ns_ida, head->instance);
673673
cleanup_srcu_struct(&head->srcu);
674674
nvme_put_subsystem(head->subsys);
@@ -4214,7 +4214,7 @@ static void nvme_ns_remove(struct nvme_ns *ns)
42144214
synchronize_srcu(&ns->ctrl->srcu);
42154215

42164216
if (last_path)
4217-
nvme_mpath_shutdown_disk(ns->head);
4217+
nvme_mpath_remove_disk(ns->head);
42184218
nvme_put_ns(ns);
42194219
}
42204220

drivers/nvme/host/multipath.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -698,15 +698,15 @@ static void nvme_remove_head_work(struct work_struct *work)
698698
{
699699
struct nvme_ns_head *head = container_of(to_delayed_work(work),
700700
struct nvme_ns_head, remove_work);
701-
bool shutdown = false;
701+
bool remove = false;
702702

703703
mutex_lock(&head->subsys->lock);
704704
if (list_empty(&head->list)) {
705705
list_del_init(&head->entry);
706-
shutdown = true;
706+
remove = true;
707707
}
708708
mutex_unlock(&head->subsys->lock);
709-
if (shutdown)
709+
if (remove)
710710
nvme_remove_head(head);
711711

712712
module_put(THIS_MODULE);
@@ -1286,9 +1286,9 @@ void nvme_mpath_add_disk(struct nvme_ns *ns, __le32 anagrpid)
12861286
#endif
12871287
}
12881288

1289-
void nvme_mpath_shutdown_disk(struct nvme_ns_head *head)
1289+
void nvme_mpath_remove_disk(struct nvme_ns_head *head)
12901290
{
1291-
bool shutdown = false;
1291+
bool remove = false;
12921292

12931293
mutex_lock(&head->subsys->lock);
12941294
/*
@@ -1314,15 +1314,15 @@ void nvme_mpath_shutdown_disk(struct nvme_ns_head *head)
13141314
head->delayed_removal_secs * HZ);
13151315
} else {
13161316
list_del_init(&head->entry);
1317-
shutdown = true;
1317+
remove = true;
13181318
}
13191319
out:
13201320
mutex_unlock(&head->subsys->lock);
1321-
if (shutdown)
1321+
if (remove)
13221322
nvme_remove_head(head);
13231323
}
13241324

1325-
void nvme_mpath_remove_disk(struct nvme_ns_head *head)
1325+
void nvme_mpath_put_disk(struct nvme_ns_head *head)
13261326
{
13271327
if (!head->disk)
13281328
return;

drivers/nvme/host/nvme.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl,struct nvme_ns_head *head);
966966
void nvme_mpath_add_sysfs_link(struct nvme_ns_head *ns);
967967
void nvme_mpath_remove_sysfs_link(struct nvme_ns *ns);
968968
void nvme_mpath_add_disk(struct nvme_ns *ns, __le32 anagrpid);
969-
void nvme_mpath_remove_disk(struct nvme_ns_head *head);
969+
void nvme_mpath_put_disk(struct nvme_ns_head *head);
970970
int nvme_mpath_init_identify(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id);
971971
void nvme_mpath_init_ctrl(struct nvme_ctrl *ctrl);
972972
void nvme_mpath_update(struct nvme_ctrl *ctrl);
@@ -975,7 +975,7 @@ void nvme_mpath_stop(struct nvme_ctrl *ctrl);
975975
bool nvme_mpath_clear_current_path(struct nvme_ns *ns);
976976
void nvme_mpath_revalidate_paths(struct nvme_ns *ns);
977977
void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl);
978-
void nvme_mpath_shutdown_disk(struct nvme_ns_head *head);
978+
void nvme_mpath_remove_disk(struct nvme_ns_head *head);
979979
void nvme_mpath_start_request(struct request *rq);
980980
void nvme_mpath_end_request(struct request *rq);
981981

@@ -1025,7 +1025,7 @@ static inline int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl,
10251025
static inline void nvme_mpath_add_disk(struct nvme_ns *ns, __le32 anagrpid)
10261026
{
10271027
}
1028-
static inline void nvme_mpath_remove_disk(struct nvme_ns_head *head)
1028+
static inline void nvme_mpath_put_disk(struct nvme_ns_head *head)
10291029
{
10301030
}
10311031
static inline void nvme_mpath_add_sysfs_link(struct nvme_ns *ns)
@@ -1044,7 +1044,7 @@ static inline void nvme_mpath_revalidate_paths(struct nvme_ns *ns)
10441044
static inline void nvme_mpath_clear_ctrl_paths(struct nvme_ctrl *ctrl)
10451045
{
10461046
}
1047-
static inline void nvme_mpath_shutdown_disk(struct nvme_ns_head *head)
1047+
static inline void nvme_mpath_remove_disk(struct nvme_ns_head *head)
10481048
{
10491049
}
10501050
static inline void nvme_trace_bio_complete(struct request *req)

0 commit comments

Comments
 (0)