]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
blk-mq: Export tagset iter function
authorSagi Grimberg <sagig@mellanox.com>
Tue, 3 Jan 2017 16:40:50 +0000 (08:40 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 1 Jun 2017 20:41:26 +0000 (13:41 -0700)
Its useful to iterate on all the active tags in cases
where we will need to fail all the queues IO.

Signed-off-by: Sagi Grimberg <sagig@mellanox.com>
[hch: carefully check for valid tagsets]
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
(cherry picked from commit e0489487ec9cd79ee1fa0dc5d3789c08b0e51a2c)

Orabug: 25130845

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
block/blk-mq-tag.c
drivers/nvme/host/pci.c
include/linux/blk-mq.h

index 9115c6d59948addbc445a26ad0f9ccaf4237b137..57a480d1d826e5de58b5c22d7cdb95822a476bee 100644 (file)
@@ -471,6 +471,18 @@ void blk_mq_all_tag_busy_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn,
 }
 EXPORT_SYMBOL(blk_mq_all_tag_busy_iter);
 
+void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
+               busy_tag_iter_fn *fn, void *priv)
+{
+       int i;
+
+       for (i = 0; i < tagset->nr_hw_queues; i++) {
+               if (tagset->tags && tagset->tags[i])
+                       blk_mq_all_tag_busy_iter(tagset->tags[i], fn, priv);
+       }
+}
+EXPORT_SYMBOL(blk_mq_tagset_busy_iter);
+
 void blk_mq_tag_busy_iter(struct blk_mq_hw_ctx *hctx, busy_iter_fn *fn,
                void *priv)
 {
index 60b13a65b70fc1b72dba587b0f3883708c62b6c3..4e8a26d1591e0583b153405bcccdf305c9540ef5 100644 (file)
@@ -80,7 +80,6 @@ struct nvme_queue;
 
 static int nvme_reset(struct nvme_dev *dev);
 static int nvme_process_cq(struct nvme_queue *nvmeq);
-static void nvme_unmap_data(struct nvme_dev *dev, struct nvme_iod *iod);
 static void nvme_remove_dead_ctrl(struct nvme_dev *dev);
 static void nvme_dev_disable(struct nvme_dev *dev, bool shutdown);
 
@@ -1819,9 +1818,6 @@ static void nvme_reset_work(struct work_struct *work)
        if (dev->bar)
                nvme_dev_disable(dev, false);
 
-       if (test_bit(NVME_CTRL_REMOVING, &dev->flags))
-               goto out;
-
        if (!nvme_change_ctrl_state(&dev->ctrl, NVME_CTRL_RESETTING))
                goto out;
 
index 4563ce91788daedf06ebcede05722649bfb7ce3b..6953e53cc839eb576d9008071a41674a02160fd9 100644 (file)
@@ -233,6 +233,8 @@ void blk_mq_tag_busy_iter(struct blk_mq_hw_ctx *hctx, busy_iter_fn *fn,
                void *priv);
 void blk_mq_all_tag_busy_iter(struct blk_mq_tags *tags, busy_tag_iter_fn *fn,
                void *priv);
+void blk_mq_tagset_busy_iter(struct blk_mq_tag_set *tagset,
+               busy_tag_iter_fn *fn, void *priv);
 void blk_mq_freeze_queue(struct request_queue *q);
 void blk_mq_unfreeze_queue(struct request_queue *q);
 void blk_mq_freeze_queue_start(struct request_queue *q);