Commit e5fa8140 authored by Aleksei Zakharov's avatar Aleksei Zakharov Committed by Jens Axboe

block: avoid setting nr_requests to current value

There's no reason to freeze queue and set nr_requests value
if current value is the same.
Signed-off-by: default avatarAleksei Zakharov <zakharov.a.g@yandex.ru>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f25191bb
...@@ -3089,6 +3089,9 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr) ...@@ -3089,6 +3089,9 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr)
if (!set) if (!set)
return -EINVAL; return -EINVAL;
if (q->nr_requests == nr)
return 0;
blk_mq_freeze_queue(q); blk_mq_freeze_queue(q);
blk_mq_quiesce_queue(q); blk_mq_quiesce_queue(q);
......
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