diff options
author | Christoph Hellwig <hch@lst.de> | 2022-10-30 11:07:10 +0100 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2022-11-01 08:02:47 -0600 |
commit | aae2a643f508d768b65e59da447f3b11688db3cf (patch) | |
tree | 3b519473f6e1ec60fb1f5909f88550381ecfff84 /block/elevator.c | |
parent | 81eaca442ea962c43bdb1e9cbb9eddb41b97491d (diff) | |
download | linux-aae2a643f508d768b65e59da447f3b11688db3cf.tar.gz linux-aae2a643f508d768b65e59da447f3b11688db3cf.tar.bz2 linux-aae2a643f508d768b65e59da447f3b11688db3cf.zip |
block: exit elv_iosched_show early when I/O schedulers are not supported
If the tag_set has BLK_MQ_F_NO_SCHED flag set we will never show any
scheduler, so exit early.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20221030100714.876891-4-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/block/elevator.c b/block/elevator.c index 9793af0a75a7..fa58905e6b3e 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -783,7 +783,7 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name) struct elevator_type *__e; int len = 0; - if (!queue_is_mq(q)) + if (!elv_support_iosched(q)) return sprintf(name, "none\n"); if (!q->elevator) @@ -797,8 +797,7 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name) len += sprintf(name+len, "[%s] ", elv->elevator_name); continue; } - if (elv_support_iosched(q) && - elevator_match(__e, __e->elevator_name, + if (elevator_match(__e, __e->elevator_name, q->required_elevator_features)) len += sprintf(name+len, "%s ", __e->elevator_name); } |