summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorAleksei Zakharov <zakharov.a.g@yandex.ru>2019-02-08 17:14:05 +0100
committerJens Axboe <axboe@kernel.dk>2019-02-08 20:43:25 +0100
commite5fa81408fb43ebabde65938ef8b20ae879017e7 (patch)
tree03db0911459410e6d675d08655f139cd1df19087 /block
parentcdrom: Fix race condition in cdrom_sysctl_register (diff)
downloadlinux-e5fa81408fb43ebabde65938ef8b20ae879017e7.tar.xz
linux-e5fa81408fb43ebabde65938ef8b20ae879017e7.zip
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>
Diffstat (limited to 'block')
-rw-r--r--block/blk-mq.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 8a825aebc6b5..44d471ff8754 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -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);