aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--block/elevator.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/block/elevator.c b/block/elevator.c
index 96a00c822748..ce866eb75f6a 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -134,13 +134,13 @@ static struct elevator_type *elevator_get(const char *name)
134{ 134{
135 struct elevator_type *e; 135 struct elevator_type *e;
136 136
137 spin_lock_irq(&elv_list_lock); 137 spin_lock(&elv_list_lock);
138 138
139 e = elevator_find(name); 139 e = elevator_find(name);
140 if (e && !try_module_get(e->elevator_owner)) 140 if (e && !try_module_get(e->elevator_owner))
141 e = NULL; 141 e = NULL;
142 142
143 spin_unlock_irq(&elv_list_lock); 143 spin_unlock(&elv_list_lock);
144 144
145 return e; 145 return e;
146} 146}
@@ -965,10 +965,11 @@ void elv_unregister_queue(struct request_queue *q)
965int elv_register(struct elevator_type *e) 965int elv_register(struct elevator_type *e)
966{ 966{
967 char *def = ""; 967 char *def = "";
968 spin_lock_irq(&elv_list_lock); 968
969 spin_lock(&elv_list_lock);
969 BUG_ON(elevator_find(e->elevator_name)); 970 BUG_ON(elevator_find(e->elevator_name));
970 list_add_tail(&e->list, &elv_list); 971 list_add_tail(&e->list, &elv_list);
971 spin_unlock_irq(&elv_list_lock); 972 spin_unlock(&elv_list_lock);
972 973
973 if (!strcmp(e->elevator_name, chosen_elevator) || 974 if (!strcmp(e->elevator_name, chosen_elevator) ||
974 (!*chosen_elevator && 975 (!*chosen_elevator &&
@@ -998,9 +999,9 @@ void elv_unregister(struct elevator_type *e)
998 read_unlock(&tasklist_lock); 999 read_unlock(&tasklist_lock);
999 } 1000 }
1000 1001
1001 spin_lock_irq(&elv_list_lock); 1002 spin_lock(&elv_list_lock);
1002 list_del_init(&e->list); 1003 list_del_init(&e->list);
1003 spin_unlock_irq(&elv_list_lock); 1004 spin_unlock(&elv_list_lock);
1004} 1005}
1005EXPORT_SYMBOL_GPL(elv_unregister); 1006EXPORT_SYMBOL_GPL(elv_unregister);
1006 1007
@@ -1118,7 +1119,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
1118 struct list_head *entry; 1119 struct list_head *entry;
1119 int len = 0; 1120 int len = 0;
1120 1121
1121 spin_lock_irq(&elv_list_lock); 1122 spin_lock(&elv_list_lock);
1122 list_for_each(entry, &elv_list) { 1123 list_for_each(entry, &elv_list) {
1123 struct elevator_type *__e; 1124 struct elevator_type *__e;
1124 1125
@@ -1128,7 +1129,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
1128 else 1129 else
1129 len += sprintf(name+len, "%s ", __e->elevator_name); 1130 len += sprintf(name+len, "%s ", __e->elevator_name);
1130 } 1131 }
1131 spin_unlock_irq(&elv_list_lock); 1132 spin_unlock(&elv_list_lock);
1132 1133
1133 len += sprintf(len+name, "\n"); 1134 len += sprintf(len+name, "\n");
1134 return len; 1135 return len;