summaryrefslogtreecommitdiffstats
path: root/block/blk-settings.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2016-03-30 10:21:08 -0600
committerJens Axboe <axboe@fb.com>2016-11-05 17:09:53 -0600
commitd278d4a8892f13b6a9eb6102b356402f0e062324 (patch)
tree2d1f9dc740b6d47257404c02292493568c8ee656 /block/blk-settings.c
parent600271d9000027c013c01be87cbb90a5a18c5c3f (diff)
downloadlinux-d278d4a8892f13b6a9eb6102b356402f0e062324.tar.bz2
block: add code to track actual device queue depth
For blk-mq, ->nr_requests does track queue depth, at least at init time. But for the older queue paths, it's simply a soft setting. On top of that, it's generally larger than the hardware setting on purpose, to allow backup of requests for merging. Fill a hole in struct request with a 'queue_depth' member, that drivers can call to more closely inform the block layer of the real queue depth. Signed-off-by: Jens Axboe <axboe@fb.com> Reviewed-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'block/blk-settings.c')
-rw-r--r--block/blk-settings.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/block/blk-settings.c b/block/blk-settings.c
index 55369a65dea2..9cf053759363 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -837,6 +837,18 @@ void blk_queue_flush_queueable(struct request_queue *q, bool queueable)
EXPORT_SYMBOL_GPL(blk_queue_flush_queueable);
/**
+ * blk_set_queue_depth - tell the block layer about the device queue depth
+ * @q: the request queue for the device
+ * @depth: queue depth
+ *
+ */
+void blk_set_queue_depth(struct request_queue *q, unsigned int depth)
+{
+ q->queue_depth = depth;
+}
+EXPORT_SYMBOL(blk_set_queue_depth);
+
+/**
* blk_queue_write_cache - configure queue's write cache
* @q: the request queue for the device
* @wc: write back cache on or off