Skip to content

Commit 3f2c9a9

Browse files
bvanasschejfvogel
authored andcommitted
nvme: introduce a helper function for controller deletion
This patch does not change any functionality but makes the next patch in this series easier to read. Signed-off-by: Bart Van Assche <[email protected]> Reviewed-by: Sagi Grimberg <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]> (cherry picked from commit a686ed7) Orabug: 29933727 Signed-off-by: Alan Adamson <[email protected]> Reviewed-by: John Donnelly <[email protected]>
1 parent 5f5c1ee commit 3f2c9a9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

drivers/nvme/host/core.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,8 @@ int nvme_reset_ctrl_sync(struct nvme_ctrl *ctrl)
151151
}
152152
EXPORT_SYMBOL_GPL(nvme_reset_ctrl_sync);
153153

154-
static void nvme_delete_ctrl_work(struct work_struct *work)
154+
static void nvme_do_delete_ctrl(struct nvme_ctrl *ctrl)
155155
{
156-
struct nvme_ctrl *ctrl =
157-
container_of(work, struct nvme_ctrl, delete_work);
158-
159156
dev_info(ctrl->device,
160157
"Removing ctrl: NQN \"%s\"\n", ctrl->opts->subsysnqn);
161158

@@ -167,6 +164,14 @@ static void nvme_delete_ctrl_work(struct work_struct *work)
167164
nvme_put_ctrl(ctrl);
168165
}
169166

167+
static void nvme_delete_ctrl_work(struct work_struct *work)
168+
{
169+
struct nvme_ctrl *ctrl =
170+
container_of(work, struct nvme_ctrl, delete_work);
171+
172+
nvme_do_delete_ctrl(ctrl);
173+
}
174+
170175
int nvme_delete_ctrl(struct nvme_ctrl *ctrl)
171176
{
172177
if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_DELETING))

0 commit comments

Comments
 (0)