Home Home > GIT Browse > SLE15-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2019-09-10 12:58:37 +0200
committerHannes Reinecke <hare@suse.de>2019-09-10 12:58:44 +0200
commitbbd094eb78d406a9c3f2e9d3f2e17a8b842af0fa (patch)
tree46322640645a70af19d6d5a5a9562236997a86c2
parentbe1cd5e3bac5048a2ad107ae8dea2c75d5455e98 (diff)
blk-mq: introduce blk_mq_complete_request_sync() (bsc#1145661).
-rw-r--r--block/blk-mq.c7
-rw-r--r--include/linux/blk-mq.h2
2 files changed, 8 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 15ebbbb4ca2a..2fa1753707ba 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -588,6 +588,13 @@ void blk_mq_complete_request(struct request *rq)
}
EXPORT_SYMBOL(blk_mq_complete_request);
+void blk_mq_complete_request_sync(struct request *rq)
+{
+ WRITE_ONCE(rq->state, MQ_RQ_COMPLETE);
+ rq->q->mq_ops->complete(rq);
+}
+EXPORT_SYMBOL_GPL(blk_mq_complete_request_sync);
+
int blk_mq_request_started(struct request *rq)
{
return test_bit(REQ_ATOM_STARTED, &rq->atomic_flags);
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index cfd64e500d82..346f03e240be 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -237,7 +237,7 @@ void blk_mq_add_to_requeue_list(struct request *rq, bool at_head,
void blk_mq_kick_requeue_list(struct request_queue *q);
void blk_mq_delay_kick_requeue_list(struct request_queue *q, unsigned long msecs);
void blk_mq_complete_request(struct request *rq);
-
+void blk_mq_complete_request_sync(struct request *rq);
bool blk_mq_queue_stopped(struct request_queue *q);
void blk_mq_stop_hw_queue(struct blk_mq_hw_ctx *hctx);
void blk_mq_start_hw_queue(struct blk_mq_hw_ctx *hctx);