diff options
author | Keith Busch <keith.busch@intel.com> | 2018-11-26 09:54:28 -0700 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-11-26 10:34:24 -0700 |
commit | 16c15eb16a793f2d81ae52f41f43fb6831b34212 (patch) | |
tree | 186d56d7aabeff57f4069d2b052894d5ff044584 /block/blk-mq.c | |
parent | 4ab32bf3305eedb4d31f85cac68a67becab10494 (diff) | |
download | linux-16c15eb16a793f2d81ae52f41f43fb6831b34212.tar.bz2 |
blk-mq: Return true if request was completed
A driver may have internal state to cleanup if we're pretending a request
didn't complete. Return 'false' if the command wasn't actually completed
due to the timeout error injection, and true otherwise.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 37674c1766a7..7c8cfa0cd420 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -638,11 +638,12 @@ static void hctx_lock(struct blk_mq_hw_ctx *hctx, int *srcu_idx) * Ends all I/O on a request. It does not handle partial completions. * The actual completion happens out-of-order, through a IPI handler. **/ -void blk_mq_complete_request(struct request *rq) +bool blk_mq_complete_request(struct request *rq) { if (unlikely(blk_should_fake_timeout(rq->q))) - return; + return false; __blk_mq_complete_request(rq); + return true; } EXPORT_SYMBOL(blk_mq_complete_request); |