From aae2a643f508d768b65e59da447f3b11688db3cf Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Sun, 30 Oct 2022 11:07:10 +0100 Subject: 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 Link: https://lore.kernel.org/r/20221030100714.876891-4-hch@lst.de Signed-off-by: Jens Axboe --- block/elevator.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'block') 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); } -- cgit v1.2.3