nvme-pci: use nvme core helper to cancel requests in tagset
authorGuixin Liu <kanie@linux.alibaba.com>
Fri, 8 Jul 2022 03:04:37 +0000 (11:04 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 2 Aug 2022 23:22:41 +0000 (17:22 -0600)
Use nvme core helper nvme_cancel_tagset and nvme_cancel_admin_tagset
instead of same logic code.

Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Ruozhu Li <liruozhu@huawei.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/nvme/host/pci.c

index 7e7d480..d8d0aeb 100644 (file)
@@ -2725,10 +2725,8 @@ static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown)
        nvme_pci_disable(dev);
        nvme_reap_pending_cqes(dev);
 
-       blk_mq_tagset_busy_iter(&dev->tagset, nvme_cancel_request, &dev->ctrl);
-       blk_mq_tagset_busy_iter(&dev->admin_tagset, nvme_cancel_request, &dev->ctrl);
-       blk_mq_tagset_wait_completed_request(&dev->tagset);
-       blk_mq_tagset_wait_completed_request(&dev->admin_tagset);
+       nvme_cancel_tagset(&dev->ctrl);
+       nvme_cancel_admin_tagset(&dev->ctrl);
 
        /*
         * The driver will not be starting up queues again if shutting down so