diff options
| author | Jens Axboe <axboe@fb.com> | 2016-09-21 12:12:13 -0400 |
|---|---|---|
| committer | Jens Axboe <axboe@fb.com> | 2016-09-22 16:28:38 -0400 |
| commit | 1b792f2f92784c00db2e6431496e437855d6f12a (patch) | |
| tree | 50c049a9056d96ebaf176d6a339f655282ff9098 /block | |
| parent | 63581af3f31e0dbea112b83f77c4fbb6a10e1406 (diff) | |
blk-mq: add flag for drivers wanting blocking ->queue_rq()
If a driver sets BLK_MQ_F_BLOCKING, it is allowed to block in its
->queue_rq() handler. For that case, blk-mq ensures that we always
calls it from a safe context.
Signed-off-by: Jens Axboe <axboe@fb.com>
Tested-by: Josef Bacik <jbacik@fb.com>
Diffstat (limited to 'block')
| -rw-r--r-- | block/blk-mq.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 80d483864247..e9ebe9864cc4 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
| @@ -908,7 +908,7 @@ void blk_mq_run_hw_queue(struct blk_mq_hw_ctx *hctx, bool async) | |||
| 908 | !blk_mq_hw_queue_mapped(hctx))) | 908 | !blk_mq_hw_queue_mapped(hctx))) |
| 909 | return; | 909 | return; |
| 910 | 910 | ||
| 911 | if (!async) { | 911 | if (!async && !(hctx->flags & BLK_MQ_F_BLOCKING)) { |
| 912 | int cpu = get_cpu(); | 912 | int cpu = get_cpu(); |
| 913 | if (cpumask_test_cpu(cpu, hctx->cpumask)) { | 913 | if (cpumask_test_cpu(cpu, hctx->cpumask)) { |
| 914 | __blk_mq_run_hw_queue(hctx); | 914 | __blk_mq_run_hw_queue(hctx); |
