diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-11-08 19:03:51 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-11-08 20:24:23 +0300 |
commit | ae8799125d565c798e49dcab4bf182dbfc483524 (patch) | |
tree | 9cf36f53aad46a716d8b7476da384823d82e9e38 /include/linux/blk-mq.h | |
parent | 7baa85727d0406ffd2b2303cd803a145aa35c505 (diff) | |
download | linux-ae8799125d565c798e49dcab4bf182dbfc483524.tar.xz |
blk-mq: provide a helper to check if a queue is busy
Returns true if the queue currently has requests pending,
false if not.
DM can use this to replace the atomic_inc/dec they do per device
to see if a device is busy.
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blk-mq.h')
-rw-r--r-- | include/linux/blk-mq.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index ff497dfcbbf9..929e8abc5535 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -250,6 +250,8 @@ void blk_mq_flush_plug_list(struct blk_plug *plug, bool from_schedule); void blk_mq_free_request(struct request *rq); bool blk_mq_can_queue(struct blk_mq_hw_ctx *); +bool blk_mq_queue_busy(struct request_queue *q); + enum { /* return when out of requests */ BLK_MQ_REQ_NOWAIT = (__force blk_mq_req_flags_t)(1 << 0), |