diff options
author | Christoph Hellwig <hch@lst.de> | 2017-10-29 10:44:28 +0200 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2017-11-01 16:28:04 +0100 |
commit | 29c09648734b94e42802f021658a47361169403b (patch) | |
tree | ffba40b1f6ab273b4d883f7d71a70a0af5541d3b /drivers/nvme/host/fc.c | |
parent | 71c691fd06cc2625966620c93ce21bdcce32ed95 (diff) |
nvme-fc: merge __nvme_fc_schedule_delete_work into __nvme_fc_del_ctrl
No need to have two functions doing the same thing.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/nvme/host/fc.c')
-rw-r--r-- | drivers/nvme/host/fc.c | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 50cc17e99475..827e9efbe556 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -2663,22 +2663,14 @@ nvme_fc_delete_ctrl_work(struct work_struct *work) nvme_put_ctrl(&ctrl->ctrl); } -static bool -__nvme_fc_schedule_delete_work(struct nvme_fc_ctrl *ctrl) -{ - if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_DELETING)) - return true; - - if (!queue_work(nvme_wq, &ctrl->delete_work)) - return true; - - return false; -} - static int __nvme_fc_del_ctrl(struct nvme_fc_ctrl *ctrl) { - return __nvme_fc_schedule_delete_work(ctrl) ? -EBUSY : 0; + if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_DELETING)) + return -EBUSY; + if (!queue_work(nvme_wq, &ctrl->delete_work)) + return -EBUSY; + return 0; } /* @@ -2724,7 +2716,7 @@ nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status) "NVME-FC{%d}: Max reconnect attempts (%d) " "reached. Removing controller\n", ctrl->cnum, ctrl->ctrl.nr_reconnects); - WARN_ON(__nvme_fc_schedule_delete_work(ctrl)); + WARN_ON(__nvme_fc_del_ctrl(ctrl)); } } |