summaryrefslogtreecommitdiff
path: root/block/elevator.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2022-10-30 11:07:11 +0100
committerJens Axboe <axboe@kernel.dk>2022-11-01 08:02:47 -0600
commit16095af2fa2c3089ff1162e677d6596772f6f478 (patch)
tree0b6dcdb397201b99817ed45dcd622487a3f454b7 /block/elevator.c
parentaae2a643f508d768b65e59da447f3b11688db3cf (diff)
block: cleanup the variable naming in elv_iosched_store
Use eq for the elevator_queue as done elsewhere. This frees e to be used for the loop iterator instead of the odd __ prefix. In addition rename elv to cur to make it more clear it is the currently selected elevator. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20221030100714.876891-5-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/elevator.c')
-rw-r--r--block/elevator.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/block/elevator.c b/block/elevator.c
index fa58905e6b3e..72346bf2f997 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -778,9 +778,8 @@ ssize_t elv_iosched_store(struct request_queue *q, const char *buf,
ssize_t elv_iosched_show(struct request_queue *q, char *name)
{
- struct elevator_queue *e = q->elevator;
- struct elevator_type *elv = NULL;
- struct elevator_type *__e;
+ struct elevator_queue *eq = q->elevator;
+ struct elevator_type *cur = NULL, *e;
int len = 0;
if (!elv_support_iosched(q))
@@ -789,17 +788,17 @@ ssize_t elv_iosched_show(struct request_queue *q, char *name)
if (!q->elevator)
len += sprintf(name+len, "[none] ");
else
- elv = e->type;
+ cur = eq->type;
spin_lock(&elv_list_lock);
- list_for_each_entry(__e, &elv_list, list) {
- if (elv && elevator_match(elv, __e->elevator_name, 0)) {
- len += sprintf(name+len, "[%s] ", elv->elevator_name);
+ list_for_each_entry(e, &elv_list, list) {
+ if (cur && elevator_match(cur, e->elevator_name, 0)) {
+ len += sprintf(name+len, "[%s] ", cur->elevator_name);
continue;
}
- if (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);
+ len += sprintf(name+len, "%s ", e->elevator_name);
}
spin_unlock(&elv_list_lock);