aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Garry <[email protected]>2021-10-05 18:23:29 +0800
committerJens Axboe <[email protected]>2021-10-18 06:17:02 -0600
commitf6adcef5f317c78a899ca9766e90e47026834158 (patch)
tree95c604236291598a242dceb184fffe7377f2a6e7
parent8fa044640f128c0cd015f72cda42989a664889fc (diff)
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 <[email protected]> Reviewed-by: Ming Lei <[email protected]> Reviewed-by: Hannes Reinecke <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
-rw-r--r--block/blk-mq.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c
index 240c04aaa3f8..ca0e65117064 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -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
* 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;