aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-05-27 17:51:00 -0600
committerJens Axboe <axboe@fb.com>2014-05-27 17:51:00 -0600
commit759b5a0be51e96954227795dd94ed0541855ed55 (patch)
tree3ff51d7c4b3b2f5b403f8f40754c578566a148c7
parent9cf4e128c6fa836e3bac0538616a136cf319565e (diff)
parent95f096849932fe5eaa7bfec887530cf556744a76 (diff)
downloadlinux-block-for-next.tar.gz
Merge branch 'for-3.16/core' into for-nextfor-next
-rw-r--r--block/blk-mq.c12
-rw-r--r--include/linux/blk-mq.h4
2 files changed, 13 insertions, 3 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 30bad930e661bc..010b878d53b384 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -434,10 +434,16 @@ void __blk_mq_complete_request(struct request *rq)
**/
void blk_mq_complete_request(struct request *rq)
{
- if (unlikely(blk_should_fake_timeout(rq->q)))
+ struct request_queue *q = rq->q;
+
+ if (unlikely(blk_should_fake_timeout(q)))
return;
- if (!blk_mark_rq_complete(rq))
- __blk_mq_complete_request(rq);
+ if (!blk_mark_rq_complete(rq)) {
+ if (q->softirq_done_fn)
+ __blk_mq_complete_request(rq);
+ else
+ blk_mq_end_io(rq, rq->errors);
+ }
}
EXPORT_SYMBOL(blk_mq_complete_request);
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index afeb934969074b..1dfeb1529a61a5 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -173,6 +173,10 @@ void __blk_mq_end_io(struct request *rq, int error);
void blk_mq_requeue_request(struct request *rq);
+/*
+ * Complete request through potential IPI for right placement. Driver must
+ * have defined a mq_ops->complete() hook for this.
+ */
void blk_mq_complete_request(struct request *rq);
void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx);