summaryrefslogtreecommitdiffstats
path: root/block/blk-mq-tag.c
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2016-03-10 13:58:46 +0200
committerJens Axboe <axboe@fb.com>2016-04-12 13:43:53 -0600
commite0489487ec9cd79ee1fa0dc5d3789c08b0e51a2c (patch)
treee970b4bbd0d17b9049b243171ed65438e3f5053a /block/blk-mq-tag.c
parent37e58237a16b94fcd2c2d1b7e9c6e1ca661c231b (diff)
downloadlinux-stable-e0489487ec9cd79ee1fa0dc5d3789c08b0e51a2c.tar.gz
linux-stable-e0489487ec9cd79ee1fa0dc5d3789c08b0e51a2c.tar.bz2
linux-stable-e0489487ec9cd79ee1fa0dc5d3789c08b0e51a2c.zip
blk-mq: Export tagset iter function
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>
Diffstat (limited to 'block/blk-mq-tag.c')
-rw-r--r--block/blk-mq-tag.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index abdbb47405cb..2fd04286f103 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -474,6 +474,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_queue_tag_busy_iter(struct request_queue *q, busy_iter_fn *fn,
void *priv)
{