Commit c76cbbcf authored by Wei Fang's avatar Wei Fang Committed by Jens Axboe

blk-mq: put blk_queue_rq_timeout together in blk_mq_init_queue()

Don't assign ->rq_timeout twice.
Signed-off-by: default avatarWei Fang <fangwei1@huawei.com>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent f9018ac9
...@@ -1956,7 +1956,7 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set, ...@@ -1956,7 +1956,7 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
goto err_hctxs; goto err_hctxs;
setup_timer(&q->timeout, blk_mq_rq_timer, (unsigned long) q); 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_queues = nr_cpu_ids;
q->nr_hw_queues = set->nr_hw_queues; 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, ...@@ -1982,9 +1982,6 @@ struct request_queue *blk_mq_init_allocated_queue(struct blk_mq_tag_set *set,
else else
blk_queue_make_request(q, blk_sq_make_request); 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... * Do this after blk_queue_make_request() overrides it...
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment