summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Fang <fangwei1@huawei.com>2015-03-30 09:07:00 -0600
committerJens Axboe <axboe@fb.com>2015-03-30 09:07:00 -0600
commitc76cbbcf404475f8885b2252049dac99b0614868 (patch)
tree3fc6b8ccb582d06b784566c7023af49c259cc31b
parentf9018ac9308ea415e659cfbdda040504ef92597b (diff)
blk-mq: put blk_queue_rq_timeout together in blk_mq_init_queue()
Don't assign ->rq_timeout twice. Signed-off-by: Wei Fang <fangwei1@huawei.com> Signed-off-by: Jens Axboe <axboe@fb.com>
-rw-r--r--block/blk-mq.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 37f14362aa15..1192f85e5ff3 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -1956,7 +1956,7 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
goto err_hctxs;
setup_timer(&q->timeout, blk_mq_rq_timer, (unsigned long) q);
- blk_queue_rq_timeout(q, 30000);
+ blk_queue_rq_timeout(q, set->timeout ? set->timeout : 30000);
q->nr_queues = nr_cpu_ids;
q->nr_hw_queues = set->nr_hw_queues;
@@ -1982,9 +1982,6 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
else
blk_queue_make_request(q, blk_sq_make_request);
- if (set->timeout)
- blk_queue_rq_timeout(q, set->timeout);
-
/*
* Do this after blk_queue_make_request() overrides it...
*/