diff options
-rw-r--r-- | block/blk-mq.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 5443aea36542..0f5879c42dcd 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -359,7 +359,7 @@ static void __blk_mq_complete_request_remote(void *data) | |||
359 | rq->q->softirq_done_fn(rq); | 359 | rq->q->softirq_done_fn(rq); |
360 | } | 360 | } |
361 | 361 | ||
362 | void __blk_mq_complete_request(struct request *rq) | 362 | static void blk_mq_ipi_complete_request(struct request *rq) |
363 | { | 363 | { |
364 | struct blk_mq_ctx *ctx = rq->mq_ctx; | 364 | struct blk_mq_ctx *ctx = rq->mq_ctx; |
365 | bool shared = false; | 365 | bool shared = false; |
@@ -385,6 +385,16 @@ void __blk_mq_complete_request(struct request *rq) | |||
385 | put_cpu(); | 385 | put_cpu(); |
386 | } | 386 | } |
387 | 387 | ||
388 | void __blk_mq_complete_request(struct request *rq) | ||
389 | { | ||
390 | struct request_queue *q = rq->q; | ||
391 | |||
392 | if (!q->softirq_done_fn) | ||
393 | blk_mq_end_io(rq, rq->errors); | ||
394 | else | ||
395 | blk_mq_ipi_complete_request(rq); | ||
396 | } | ||
397 | |||
388 | /** | 398 | /** |
389 | * blk_mq_complete_request - end I/O on a request | 399 | * blk_mq_complete_request - end I/O on a request |
390 | * @rq: the request being processed | 400 | * @rq: the request being processed |
@@ -399,12 +409,8 @@ void blk_mq_complete_request(struct request *rq) | |||
399 | 409 | ||
400 | if (unlikely(blk_should_fake_timeout(q))) | 410 | if (unlikely(blk_should_fake_timeout(q))) |
401 | return; | 411 | return; |
402 | if (!blk_mark_rq_complete(rq)) { | 412 | if (!blk_mark_rq_complete(rq)) |
403 | if (q->softirq_done_fn) | 413 | __blk_mq_complete_request(rq); |
404 | __blk_mq_complete_request(rq); | ||
405 | else | ||
406 | blk_mq_end_io(rq, rq->errors); | ||
407 | } | ||
408 | } | 414 | } |
409 | EXPORT_SYMBOL(blk_mq_complete_request); | 415 | EXPORT_SYMBOL(blk_mq_complete_request); |
410 | 416 | ||