nvme-rdma: remove nvme_rdma_remove_ctrl
authorChristoph Hellwig <hch@lst.de>
Sun, 29 Oct 2017 08:44:30 +0000 (10:44 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 1 Nov 2017 15:28:05 +0000 (16:28 +0100)
It is only used in two places, and some of the work done by it will
be taken into common code soon.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/rdma.c

index 5175b465997d0bc8c6325c9913a851fbb49d597a..a3521b852ea85f1fb1d6650fa2c5b8f1109116d0 100644 (file)
@@ -1755,18 +1755,13 @@ static void nvme_rdma_shutdown_ctrl(struct nvme_rdma_ctrl *ctrl, bool shutdown)
        nvme_rdma_destroy_admin_queue(ctrl, shutdown);
 }
 
-static void nvme_rdma_remove_ctrl(struct nvme_rdma_ctrl *ctrl)
-{
-       nvme_remove_namespaces(&ctrl->ctrl);
-       nvme_rdma_shutdown_ctrl(ctrl, true);
-       nvme_uninit_ctrl(&ctrl->ctrl);
-       nvme_put_ctrl(&ctrl->ctrl);
-}
-
 static void nvme_rdma_delete_ctrl(struct nvme_ctrl *ctrl)
 {
        nvme_stop_ctrl(ctrl);
-       nvme_rdma_remove_ctrl(to_rdma_ctrl(ctrl));
+       nvme_remove_namespaces(ctrl);
+       nvme_rdma_shutdown_ctrl(to_rdma_ctrl(ctrl), true);
+       nvme_uninit_ctrl(ctrl);
+       nvme_put_ctrl(ctrl);
 }
 
 static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
@@ -1802,7 +1797,10 @@ static void nvme_rdma_reset_ctrl_work(struct work_struct *work)
 
 out_fail:
        dev_warn(ctrl->ctrl.device, "Removing after reset failure\n");
-       nvme_rdma_remove_ctrl(ctrl);
+       nvme_remove_namespaces(&ctrl->ctrl);
+       nvme_rdma_shutdown_ctrl(ctrl, true);
+       nvme_uninit_ctrl(&ctrl->ctrl);
+       nvme_put_ctrl(&ctrl->ctrl);
 }
 
 static const struct nvme_ctrl_ops nvme_rdma_ctrl_ops = {