diff options
author | Christoph Hellwig <hch@lst.de> | 2015-09-27 22:01:51 +0300 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-10-01 11:10:57 +0300 |
commit | 0bf6cd5b9531bcc29c0a5e504b6ce2984c6fd8d8 (patch) | |
tree | bf6d257b11c79cda7f8f44e3fd8d9c535143fdfd /block/blk-mq.c | |
parent | f4829a9b7a61e159367350008a608b062c4f6840 (diff) | |
download | linux-0bf6cd5b9531bcc29c0a5e504b6ce2984c6fd8d8.tar.xz |
blk-mq: factor out a helper to iterate all tags for a request_queue
And replace the blk_mq_tag_busy_iter with it - the driver use has been
replaced with a new helper a while ago, and internal to the block we
only need the new version.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 2306330530e8..7785ae96267a 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -641,24 +641,16 @@ static void blk_mq_rq_timer(unsigned long priv) .next = 0, .next_set = 0, }; - struct blk_mq_hw_ctx *hctx; int i; - queue_for_each_hw_ctx(q, hctx, i) { - /* - * If not software queues are currently mapped to this - * hardware queue, there's nothing to check - */ - if (!blk_mq_hw_queue_mapped(hctx)) - continue; - - blk_mq_tag_busy_iter(hctx, blk_mq_check_expired, &data); - } + blk_mq_queue_tag_busy_iter(q, blk_mq_check_expired, &data); if (data.next_set) { data.next = blk_rq_timeout(round_jiffies_up(data.next)); mod_timer(&q->timeout, data.next); } else { + struct blk_mq_hw_ctx *hctx; + queue_for_each_hw_ctx(q, hctx, i) { /* the hctx may be unmapped, so check it here */ if (blk_mq_hw_queue_mapped(hctx)) |