Skip to content

Commit

Permalink
block: exit elv_iosched_show early when I/O schedulers are not supported
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Christoph Hellwig authored and axboe committed Nov 1, 2022
1 parent 81eaca4 commit aae2a64
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
}
Expand Down

0 comments on commit aae2a64

Please sign in to comment.