summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2017-03-01 20:22:11 +0100
committerJens Axboe <axboe@fb.com>2017-03-02 16:56:04 +0100
commitf91328c40a559362b6e7b7bfee01ca17fda87592 (patch)
treeb3bee10257454a313e11912a5754f0d4fb321e46 /block
parentblk-mq: Export blk_mq_freeze_queue_wait (diff)
downloadlinux-f91328c40a559362b6e7b7bfee01ca17fda87592.tar.xz
linux-f91328c40a559362b6e7b7bfee01ca17fda87592.zip
blk-mq: Provide freeze queue timeout
A driver may wish to take corrective action if queued requests do not complete within a set time. Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 8da2c04bb88f..a5e66a7a3506 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -81,6 +81,15 @@ void blk_mq_freeze_queue_wait(struct request_queue *q)
}
EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_wait);
+int blk_mq_freeze_queue_wait_timeout(struct request_queue *q,
+ unsigned long timeout)
+{
+ return wait_event_timeout(q->mq_freeze_wq,
+ percpu_ref_is_zero(&q->q_usage_counter),
+ timeout);
+}
+EXPORT_SYMBOL_GPL(blk_mq_freeze_queue_wait_timeout);
+
/*
* Guarantee no request is in use, so we can change any data structure of
* the queue afterward.