diff options
Diffstat (limited to 'block/elevator.c')
-rw-r--r-- | block/elevator.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/block/elevator.c b/block/elevator.c index 487dd3da8853..8ccd163254b8 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) |
@@ -1088,7 +1085,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name) | |||
1088 | struct list_head *entry; | 1085 | struct list_head *entry; |
1089 | int len = 0; | 1086 | int len = 0; |
1090 | 1087 | ||
1091 | spin_lock_irq(q->queue_lock); | 1088 | spin_lock_irq(&elv_list_lock); |
1092 | list_for_each(entry, &elv_list) { | 1089 | list_for_each(entry, &elv_list) { |
1093 | struct elevator_type *__e; | 1090 | struct elevator_type *__e; |
1094 | 1091 | ||
@@ -1098,7 +1095,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name) | |||
1098 | else | 1095 | else |
1099 | len += sprintf(name+len, "%s ", __e->elevator_name); | 1096 | len += sprintf(name+len, "%s ", __e->elevator_name); |
1100 | } | 1097 | } |
1101 | spin_unlock_irq(q->queue_lock); | 1098 | spin_unlock_irq(&elv_list_lock); |
1102 | 1099 | ||
1103 | len += sprintf(len+name, "\n"); | 1100 | len += sprintf(len+name, "\n"); |
1104 | return len; | 1101 | return len; |