提交 a22b169d 编写于 作者: V Vasily Tarasov 提交者: Jens Axboe

[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: NVasily Tarasov <vtaras@openvz.org>
Signed-off-by: NJens Axboe <jens.axboe@oracle.com>
上级 2b1191af
......@@ -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)
{
struct elevator_type *e = NULL;
struct elevator_type *e;
struct list_head *entry;
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)) {
e = __e;
break;
}
if (!strcmp(e->elevator_name, name))
return e;
}
return e;
return NULL;
}
static void elevator_put(struct elevator_type *e)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册