diff options
author | Vasily Tarasov <vtaras@openvz.org> | 2006-10-11 03:24:27 -0400 |
---|---|---|
committer | Jens Axboe <axboe@nelson.home.kernel.dk> | 2006-10-12 09:08:51 -0400 |
commit | a22b169df1b9f259391cf3b8ad8bfeea3d7be3f1 (patch) | |
tree | c03c0fb3de87afc0c67a4a973a826deed4bb9d20 /block/elevator.c | |
parent | 2b1191af683d16a899c2b81b87b605841ceffdec (diff) |
[PATCH] block layer: elevator_find function cleanup
We can easily produce search through the elevator list
without introducing additional elevator_type variable.
Signed-off-by: Vasily Tarasov <vtaras@openvz.org>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/block/elevator.c b/block/elevator.c index 487dd3da8853..d8030a84773a 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -93,21 +93,18 @@ static inline int elv_try_merge(struct request *__rq, struct bio *bio) | |||
93 | 93 | ||
94 | static struct elevator_type *elevator_find(const char *name) | 94 | static struct elevator_type *elevator_find(const char *name) |
95 | { | 95 | { |
96 | struct elevator_type *e = NULL; | 96 | struct elevator_type *e; |
97 | struct list_head *entry; | 97 | struct list_head *entry; |
98 | 98 | ||
99 | list_for_each(entry, &elv_list) { | 99 | list_for_each(entry, &elv_list) { |
100 | struct elevator_type *__e; | ||
101 | 100 | ||
102 | __e = list_entry(entry, struct elevator_type, list); | 101 | e = list_entry(entry, struct elevator_type, list); |
103 | 102 | ||
104 | if (!strcmp(__e->elevator_name, name)) { | 103 | if (!strcmp(e->elevator_name, name)) |
105 | e = __e; | 104 | return e; |
106 | break; | ||
107 | } | ||
108 | } | 105 | } |
109 | 106 | ||
110 | return e; | 107 | return NULL; |
111 | } | 108 | } |
112 | 109 | ||
113 | static void elevator_put(struct elevator_type *e) | 110 | static void elevator_put(struct elevator_type *e) |