[PATCH 2/6] nvme: tcp: remove 'shutdown' parameters from two teardown helpers
Ming Lei
ming.lei at redhat.com
Mon Jul 10 08:35:51 PDT 2023
'shutdown' is just for unquiescing queues, and we can do that outside
the caller, and turns out more readable given unquiesce isn't needed
in error recovery code path.
Signed-off-by: Ming Lei <ming.lei at redhat.com>
---
drivers/nvme/host/tcp.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c
index 3e7dd6f91832..e414cfb3433f 100644
--- a/drivers/nvme/host/tcp.c
+++ b/drivers/nvme/host/tcp.c
@@ -1962,20 +1962,16 @@ static int nvme_tcp_configure_admin_queue(struct nvme_ctrl *ctrl, bool new)
return error;
}
-static void nvme_tcp_teardown_admin_queue(struct nvme_ctrl *ctrl,
- bool remove)
+static void nvme_tcp_teardown_admin_queue(struct nvme_ctrl *ctrl)
{
nvme_quiesce_admin_queue(ctrl);
blk_sync_queue(ctrl->admin_q);
nvme_tcp_stop_queue(ctrl, 0);
nvme_cancel_admin_tagset(ctrl);
- if (remove)
- nvme_unquiesce_admin_queue(ctrl);
nvme_tcp_destroy_admin_queue(ctrl, remove);
}
-static void nvme_tcp_teardown_io_queues(struct nvme_ctrl *ctrl,
- bool remove)
+static void nvme_tcp_teardown_io_queues(struct nvme_ctrl *ctrl)
{
if (ctrl->queue_count <= 1)
return;
@@ -1985,8 +1981,6 @@ static void nvme_tcp_teardown_io_queues(struct nvme_ctrl *ctrl,
nvme_sync_io_queues(ctrl);
nvme_tcp_stop_io_queues(ctrl);
nvme_cancel_tagset(ctrl);
- if (remove)
- nvme_unquiesce_io_queues(ctrl);
nvme_tcp_destroy_io_queues(ctrl, remove);
}
@@ -2114,10 +2108,10 @@ static void nvme_tcp_error_recovery_work(struct work_struct *work)
nvme_stop_keep_alive(ctrl);
flush_work(&ctrl->async_event_work);
- nvme_tcp_teardown_io_queues(ctrl, false);
+ nvme_tcp_teardown_io_queues(ctrl);
/* unquiesce to fail fast pending requests */
nvme_unquiesce_io_queues(ctrl);
- nvme_tcp_teardown_admin_queue(ctrl, false);
+ nvme_tcp_teardown_admin_queue(ctrl);
nvme_unquiesce_admin_queue(ctrl);
nvme_auth_stop(ctrl);
@@ -2133,10 +2127,14 @@ static void nvme_tcp_error_recovery_work(struct work_struct *work)
static void nvme_tcp_teardown_ctrl(struct nvme_ctrl *ctrl, bool shutdown)
{
- nvme_tcp_teardown_io_queues(ctrl, shutdown);
+ nvme_tcp_teardown_io_queues(ctrl);
nvme_quiesce_admin_queue(ctrl);
nvme_disable_ctrl(ctrl, shutdown);
- nvme_tcp_teardown_admin_queue(ctrl, shutdown);
+ nvme_tcp_teardown_admin_queue(ctrl);
+ if (shutdown) {
+ nvme_unquiesce_io_queues(ctrl);
+ nvme_unquiesce_admin_queue(ctrl);
+ }
}
static void nvme_tcp_delete_ctrl(struct nvme_ctrl *ctrl)
--
2.40.1
More information about the Linux-nvme
mailing list