nvme-loop: use nvme core helpers to cancel all requests in a tagset
authorSagi Grimberg <sagi@grimberg.me>
Sun, 26 Jun 2022 14:06:00 +0000 (17:06 +0300)
committerChristoph Hellwig <hch@lst.de>
Wed, 6 Jul 2022 16:14:23 +0000 (18:14 +0200)
A helper now exist, no need to open-code the same functionality.

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/loop.c

index 59024af2da2e3d22edb5148f4d31dcbcc87768ff..9c9c428ae53800e6dd01f420ea5ea83c3d3fafba 100644 (file)
@@ -424,9 +424,7 @@ static void nvme_loop_shutdown_ctrl(struct nvme_loop_ctrl *ctrl)
 {
        if (ctrl->ctrl.queue_count > 1) {
                nvme_stop_queues(&ctrl->ctrl);
-               blk_mq_tagset_busy_iter(&ctrl->tag_set,
-                                       nvme_cancel_request, &ctrl->ctrl);
-               blk_mq_tagset_wait_completed_request(&ctrl->tag_set);
+               nvme_cancel_tagset(&ctrl->ctrl);
                nvme_loop_destroy_io_queues(ctrl);
        }
 
@@ -434,9 +432,7 @@ static void nvme_loop_shutdown_ctrl(struct nvme_loop_ctrl *ctrl)
        if (ctrl->ctrl.state == NVME_CTRL_LIVE)
                nvme_shutdown_ctrl(&ctrl->ctrl);
 
-       blk_mq_tagset_busy_iter(&ctrl->admin_tag_set,
-                               nvme_cancel_request, &ctrl->ctrl);
-       blk_mq_tagset_wait_completed_request(&ctrl->admin_tag_set);
+       nvme_cancel_admin_tagset(&ctrl->ctrl);
        nvme_loop_destroy_admin_queue(ctrl);
 }