Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

nvme-tcp: simplify nvme_tcp_teardown_io_queues()

As nvme_tcp_teardown_io_queues() is the only one caller of
nvme_tcp_destroy_admin_queue(), so we can merge it into
nvme_tcp_teardown_io_queues() to simplify the code.

Signed-off-by: Chunguang.xu <chunguang.xu@shopee.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>

authored by

Chunguang.xu and committed by
Keith Busch
b4e12f57 fdc5664c

+4 -10
+4 -10
drivers/nvme/host/tcp.c
··· 2101 2101 return ret; 2102 2102 } 2103 2103 2104 - static void nvme_tcp_destroy_admin_queue(struct nvme_ctrl *ctrl, bool remove) 2105 - { 2106 - nvme_tcp_stop_queue(ctrl, 0); 2107 - if (remove) 2108 - nvme_remove_admin_tag_set(ctrl); 2109 - nvme_tcp_free_admin_queue(ctrl); 2110 - } 2111 - 2112 2104 static int nvme_tcp_configure_admin_queue(struct nvme_ctrl *ctrl, bool new) 2113 2105 { 2114 2106 int error; ··· 2155 2163 blk_sync_queue(ctrl->admin_q); 2156 2164 nvme_tcp_stop_queue(ctrl, 0); 2157 2165 nvme_cancel_admin_tagset(ctrl); 2158 - if (remove) 2166 + if (remove) { 2159 2167 nvme_unquiesce_admin_queue(ctrl); 2160 - nvme_tcp_destroy_admin_queue(ctrl, remove); 2168 + nvme_remove_admin_tag_set(ctrl); 2169 + } 2170 + nvme_tcp_free_admin_queue(ctrl); 2161 2171 if (ctrl->tls_pskid) { 2162 2172 dev_dbg(ctrl->device, "Wipe negotiated TLS_PSK %08x\n", 2163 2173 ctrl->tls_pskid);