[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>
This commit is contained in:
committed by
Jens Axboe
parent
2b1191af68
commit
a22b169df1
@@ -93,21 +93,18 @@ static inline int elv_try_merge(struct request *__rq, struct bio *bio)
|
|||||||
|
|
||||||
static struct elevator_type *elevator_find(const char *name)
|
static struct elevator_type *elevator_find(const char *name)
|
||||||
{
|
{
|
||||||
struct elevator_type *e = NULL;
|
struct elevator_type *e;
|
||||||
struct list_head *entry;
|
struct list_head *entry;
|
||||||
|
|
||||||
list_for_each(entry, &elv_list) {
|
list_for_each(entry, &elv_list) {
|
||||||
struct elevator_type *__e;
|
|
||||||
|
|
||||||
__e = list_entry(entry, struct elevator_type, list);
|
e = list_entry(entry, struct elevator_type, list);
|
||||||
|
|
||||||
if (!strcmp(__e->elevator_name, name)) {
|
if (!strcmp(e->elevator_name, name))
|
||||||
e = __e;
|
return e;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return e;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void elevator_put(struct elevator_type *e)
|
static void elevator_put(struct elevator_type *e)
|
||||||
|
Reference in New Issue
Block a user