blk-mq: add blk_mq_start_stopped_hw_queue()
authorJens Axboe <axboe@fb.com>
Thu, 8 Dec 2016 20:19:30 +0000 (13:19 -0700)
committerJens Axboe <axboe@fb.com>
Fri, 9 Dec 2016 16:03:02 +0000 (09:03 -0700)
We have a variant for all hardware queues, but not one for a single
hardware queue.

Signed-off-by: Jens Axboe <axboe@fb.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
block/blk-mq.c
include/linux/blk-mq.h

index 90db5b490df9a7a9bf768937c6cb06415b400cce..c993476b630f95234ec7b37eb5f37f754d887135 100644 (file)
@@ -1064,18 +1064,23 @@ void blk_mq_start_hw_queues(struct request_queue *q)
 }
 EXPORT_SYMBOL(blk_mq_start_hw_queues);
 
+void blk_mq_start_stopped_hw_queue(struct blk_mq_hw_ctx *hctx, bool async)
+{
+       if (!blk_mq_hctx_stopped(hctx))
+               return;
+
+       clear_bit(BLK_MQ_S_STOPPED, &hctx->state);
+       blk_mq_run_hw_queue(hctx, async);
+}
+EXPORT_SYMBOL_GPL(blk_mq_start_stopped_hw_queue);
+
 void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async)
 {
        struct blk_mq_hw_ctx *hctx;
        int i;
 
-       queue_for_each_hw_ctx(q, hctx, i) {
-               if (!blk_mq_hctx_stopped(hctx))
-                       continue;
-
-               clear_bit(BLK_MQ_S_STOPPED, &hctx->state);
-               blk_mq_run_hw_queue(hctx, async);
-       }
+       queue_for_each_hw_ctx(q, hctx, i)
+               blk_mq_start_stopped_hw_queue(hctx, async);
 }
 EXPORT_SYMBOL(blk_mq_start_stopped_hw_queues);
 
index 35a0af5ede6d1e4e73727a01e5e2613dda203d46..87e404aae267e29308d784d66ed8c15fbfdede0e 100644 (file)
@@ -231,6 +231,7 @@ void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx);
 void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx);
 void blk_mq_stop_hw_queues(struct request_queue *q);
 void blk_mq_start_hw_queues(struct request_queue *q);
+void blk_mq_start_stopped_hw_queue(struct blk_mq_hw_ctx *hctx, bool async);
 void blk_mq_start_stopped_hw_queues(struct request_queue *q, bool async);
 void blk_mq_run_hw_queues(struct request_queue *q, bool async);
 void blk_mq_delay_queue(struct blk_mq_hw_ctx *hctx, unsigned long msecs);