Commit f6adcef5 authored by John Garry's avatar John Garry Committed by Jens Axboe

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: default avatarJohn Garry <john.garry@huawei.com>
Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Link: https://lore.kernel.org/r/1633429419-228500-5-git-send-email-john.garry@huawei.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 8fa04464
...@@ -3622,18 +3622,18 @@ int blk_mq_update_nr_requests(struct request_queue *q, unsigned int nr) ...@@ -3622,18 +3622,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 * If we're using an MQ scheduler, just update the scheduler
* queue depth. This is similar to what the old code would do. * queue depth. This is similar to what the old code would do.
*/ */
if (!hctx->sched_tags) { if (hctx->sched_tags) {
ret = blk_mq_tag_update_depth(hctx, &hctx->tags, nr,
false);
} else {
ret = blk_mq_tag_update_depth(hctx, &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)) { if (blk_mq_is_sbitmap_shared(set->flags)) {
hctx->sched_tags->bitmap_tags = hctx->sched_tags->bitmap_tags =
&q->sched_bitmap_tags; &q->sched_bitmap_tags;
hctx->sched_tags->breserved_tags = hctx->sched_tags->breserved_tags =
&q->sched_breserved_tags; &q->sched_breserved_tags;
} }
} else {
ret = blk_mq_tag_update_depth(hctx, &hctx->tags, nr,
false);
} }
if (ret) if (ret)
break; break;
......
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