diff options
author | Bart Van Assche <bvanassche@acm.org> | 2019-02-15 01:50:56 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2019-02-20 17:18:21 +0300 |
commit | a686ed75c0fb1ee2b87920aedc2027491da9fe6d (patch) | |
tree | 5cd68ebb43a5f3dd84661a82d9fba2f7f84c1849 /drivers/nvme | |
parent | d84c4b024ac36c778fd6020fb8560447365a5478 (diff) | |
download | linux-a686ed75c0fb1ee2b87920aedc2027491da9fe6d.tar.xz |
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 <bvanassche@acm.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme')
-rw-r--r-- | drivers/nvme/host/core.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 2c7a7a4f532f..9ec88253ebcd 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -151,11 +151,8 @@ int nvme_reset_ctrl_sync(struct nvme_ctrl *ctrl) } EXPORT_SYMBOL_GPL(nvme_reset_ctrl_sync); -static void nvme_delete_ctrl_work(struct work_struct *work) +static void nvme_do_delete_ctrl(struct nvme_ctrl *ctrl) { - struct nvme_ctrl *ctrl = - container_of(work, struct nvme_ctrl, delete_work); - dev_info(ctrl->device, "Removing ctrl: NQN \"%s\"\n", ctrl->opts->subsysnqn); @@ -167,6 +164,14 @@ static void nvme_delete_ctrl_work(struct work_struct *work) nvme_put_ctrl(ctrl); } +static void nvme_delete_ctrl_work(struct work_struct *work) +{ + struct nvme_ctrl *ctrl = + container_of(work, struct nvme_ctrl, delete_work); + + nvme_do_delete_ctrl(ctrl); +} + int nvme_delete_ctrl(struct nvme_ctrl *ctrl) { if (!nvme_change_ctrl_state(ctrl, NVME_CTRL_DELETING)) |