summaryrefslogtreecommitdiff
path: root/block/blk-timeout.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2014-05-19 17:52:35 (GMT)
committerJens Axboe <axboe@fb.com>2014-05-19 17:52:35 (GMT)
commit39a9f97e5ea99e048c4980c23cf197f6e77995cb (patch)
treeb1f72ed1e852372b6d86b79157b09f77fabc5a20 /block/blk-timeout.c
parent1429d7c9467e1e3de0b0ff91d7e4d67c1a92f8a3 (diff)
parent0d2602ca30e410e84e8bdf05c84ed5688e0a5a44 (diff)
downloadlinux-39a9f97e5ea99e048c4980c23cf197f6e77995cb.tar.xz
Merge branch 'for-3.16/blk-mq-tagging' into for-3.16/core
Signed-off-by: Jens Axboe <axboe@fb.com> Conflicts: block/blk-mq-tag.c
Diffstat (limited to 'block/blk-timeout.c')
-rw-r--r--block/blk-timeout.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/block/blk-timeout.c b/block/blk-timeout.c
index 4487456..43e8b51 100644
--- a/block/blk-timeout.c
+++ b/block/blk-timeout.c
@@ -166,6 +166,17 @@ void blk_abort_request(struct request *req)
}
EXPORT_SYMBOL_GPL(blk_abort_request);
+unsigned long blk_rq_timeout(unsigned long timeout)
+{
+ unsigned long maxt;
+
+ maxt = round_jiffies_up(jiffies + BLK_MAX_TIMEOUT);
+ if (time_after(timeout, maxt))
+ timeout = maxt;
+
+ return timeout;
+}
+
/**
* blk_add_timer - Start timeout timer for a single request
* @req: request that is about to start running.
@@ -200,7 +211,7 @@ void blk_add_timer(struct request *req)
* than an existing one, modify the timer. Round up to next nearest
* second.
*/
- expiry = round_jiffies_up(req->deadline);
+ expiry = blk_rq_timeout(round_jiffies_up(req->deadline));
if (!timer_pending(&q->timeout) ||
time_before(expiry, q->timeout.expires)) {