diff options
author | Ming Lei <ming.lei@redhat.com> | 2019-07-23 23:48:39 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2019-08-04 23:41:29 -0400 |
commit | aa306ab703e9452b1e25cc8e8f04b8df523d0bb8 (patch) | |
tree | 788e30753358ef836231752766f417c9540018cb /block | |
parent | e21a712a9685488f5ce80495b37b9fdbe96c230d (diff) |
blk-mq: introduce blk_mq_request_completed()
NVMe needs this function to decide if one request to be aborted has
been completed in normal IO path already.
So introduce it.
Cc: Max Gurtovoy <maxg@mellanox.com>
Cc: Sagi Grimberg <sagi@grimberg.me>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-mq.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index f78d3287dd82..8bb5854a62f3 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c | |||
@@ -665,6 +665,12 @@ int blk_mq_request_started(struct request *rq) | |||
665 | } | 665 | } |
666 | EXPORT_SYMBOL_GPL(blk_mq_request_started); | 666 | EXPORT_SYMBOL_GPL(blk_mq_request_started); |
667 | 667 | ||
668 | int blk_mq_request_completed(struct request *rq) | ||
669 | { | ||
670 | return blk_mq_rq_state(rq) == MQ_RQ_COMPLETE; | ||
671 | } | ||
672 | EXPORT_SYMBOL_GPL(blk_mq_request_completed); | ||
673 | |||
668 | void blk_mq_start_request(struct request *rq) | 674 | void blk_mq_start_request(struct request *rq) |
669 | { | 675 | { |
670 | struct request_queue *q = rq->q; | 676 | struct request_queue *q = rq->q; |