summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2016-12-08 21:19:30 +0100
committerJens Axboe <axboe@fb.com>2016-12-09 17:03:02 +0100
commitae911c5e796d51cb2d1ed3a55e73b9cc88d176cf (patch)
tree8d13dbeff76c57c2f61a19a13e64dbda40c04b9c /block
parentblock: improve handling of the magic discard payload (diff)
downloadlinux-ae911c5e796d51cb2d1ed3a55e73b9cc88d176cf.tar.xz
linux-ae911c5e796d51cb2d1ed3a55e73b9cc88d176cf.zip
blk-mq: add blk_mq_start_stopped_hw_queue()
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>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 90db5b490df9..c993476b630f 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -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);