summaryrefslogtreecommitdiffstats
path: root/include/linux/blk-mq.h
diff options
context:
space:
mode:
authorJens Axboe2018-10-29 17:15:10 +0100
committerJens Axboe2018-11-07 21:42:31 +0100
commit9ba20527f4d1430b5f3e5f566be5af3e156a3284 (patch)
tree0a4470642c0c4a939cf4c4d6a4bd9bf72356e962 /include/linux/blk-mq.h
parentblk-mq: remove legacy check in queue blk_freeze_queue() (diff)
downloadkernel-qcow2-linux-9ba20527f4d1430b5f3e5f566be5af3e156a3284.tar.gz
kernel-qcow2-linux-9ba20527f4d1430b5f3e5f566be5af3e156a3284.tar.xz
kernel-qcow2-linux-9ba20527f4d1430b5f3e5f566be5af3e156a3284.zip
blk-mq: provide mq_ops->busy() hook
We'll hook into this from blk_lld_busy(), allowing blk-mq to also return whether or not a given queue currently has requests in progress. Reviewed-by: Hannes Reinecke <hare@suse.com> Tested-by: Ming Lei <ming.lei@redhat.com> Reviewed-by: Omar Sandoval <osandov@fb.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'include/linux/blk-mq.h')
-rw-r--r--include/linux/blk-mq.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h
index 2286dc12c6bc..5c8418ebbfd6 100644
--- a/include/linux/blk-mq.h
+++ b/include/linux/blk-mq.h
@@ -114,6 +114,7 @@ typedef void (busy_iter_fn)(struct blk_mq_hw_ctx *, struct request *, void *,
typedef void (busy_tag_iter_fn)(struct request *, void *, bool);
typedef int (poll_fn)(struct blk_mq_hw_ctx *, unsigned int);
typedef int (map_queues_fn)(struct blk_mq_tag_set *set);
+typedef bool (busy_fn)(struct request_queue *);
struct blk_mq_ops {
@@ -165,6 +166,11 @@ struct blk_mq_ops {
/* Called from inside blk_get_request() */
void (*initialize_rq_fn)(struct request *rq);
+ /*
+ * If set, returns whether or not this queue currently is busy
+ */
+ busy_fn *busy;
+
map_queues_fn *map_queues;
#ifdef CONFIG_BLK_DEBUG_FS