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: Aleksei Zakharov <zakharov.a.g@yandex.ru>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Aleksei Zakharov 2019-02-08 19:14:05 +03:00 committed by Jens Axboe
parent f25191bb32
commit e5fa81408f
1 changed files with 3 additions and 0 deletions

View File

@ -3089,6 +3089,9 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr)
if (!set)
return -EINVAL;
if (q->nr_requests == nr)
return 0;
blk_mq_freeze_queue(q);
blk_mq_quiesce_queue(q);