[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1633429419-228500-5-git-send-email-john.garry@huawei.com>
Date: Tue, 5 Oct 2021 18:23:29 +0800
From: John Garry <john.garry@...wei.com>
To: <axboe@...nel.dk>
CC: <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<ming.lei@...hat.com>, <hare@...e.de>,
<linux-scsi@...r.kernel.org>, <kashyap.desai@...adcom.com>,
John Garry <john.garry@...wei.com>
Subject: [PATCH v5 04/14] blk-mq: Invert check in blk_mq_update_nr_requests()
It's easier to read:
if (x)
X;
else
Y;
over:
if (!x)
Y;
else
X;
No functional change intended.
Signed-off-by: John Garry <john.garry@...wei.com>
Reviewed-by: Ming Lei <ming.lei@...hat.com>
Reviewed-by: Hannes Reinecke <hare@...e.de>
---
block/blk-mq.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 290821580ecf..9895b55dff61 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -3615,18 +3615,18 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr)
* If we're using an MQ scheduler, just update the scheduler
* queue depth. This is similar to what the old code would do.
*/
- if (!hctx->sched_tags) {
- ret = blk_mq_tag_update_depth(hctx, &hctx->tags, nr,
- false);
- } else {
+ if (hctx->sched_tags) {
ret = blk_mq_tag_update_depth(hctx, &hctx->sched_tags,
- nr, true);
+ nr, true);
if (blk_mq_is_sbitmap_shared(set->flags)) {
hctx->sched_tags->bitmap_tags =
&q->sched_bitmap_tags;
hctx->sched_tags->breserved_tags =
&q->sched_breserved_tags;
}
+ } else {
+ ret = blk_mq_tag_update_depth(hctx, &hctx->tags, nr,
+ false);
}
if (ret)
break;
--
2.26.2
Powered by blists - more mailing lists