Commit 2a12dcd7 authored by Jens Axboe's avatar Jens Axboe Committed by Jens Axboe

[PATCH] elevator: elv_list_lock does not need irq disabling

It's never grabbed from irq context, so just make it plain spin_lock().
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 5972511b
...@@ -134,13 +134,13 @@ static struct elevator_type *elevator_get(const char *name) ...@@ -134,13 +134,13 @@ static struct elevator_type *elevator_get(const char *name)
{ {
struct elevator_type *e; struct elevator_type *e;
spin_lock_irq(&elv_list_lock); spin_lock(&elv_list_lock);
e = elevator_find(name); e = elevator_find(name);
if (e && !try_module_get(e->elevator_owner)) if (e && !try_module_get(e->elevator_owner))
e = NULL; e = NULL;
spin_unlock_irq(&elv_list_lock); spin_unlock(&elv_list_lock);
return e; return e;
} }
...@@ -965,10 +965,11 @@ void elv_unregister_queue(struct request_queue *q) ...@@ -965,10 +965,11 @@ void elv_unregister_queue(struct request_queue *q)
int elv_register(struct elevator_type *e) int elv_register(struct elevator_type *e)
{ {
char *def = ""; char *def = "";
spin_lock_irq(&elv_list_lock);
spin_lock(&elv_list_lock);
BUG_ON(elevator_find(e->elevator_name)); BUG_ON(elevator_find(e->elevator_name));
list_add_tail(&e->list, &elv_list); list_add_tail(&e->list, &elv_list);
spin_unlock_irq(&elv_list_lock); spin_unlock(&elv_list_lock);
if (!strcmp(e->elevator_name, chosen_elevator) || if (!strcmp(e->elevator_name, chosen_elevator) ||
(!*chosen_elevator && (!*chosen_elevator &&
...@@ -998,9 +999,9 @@ void elv_unregister(struct elevator_type *e) ...@@ -998,9 +999,9 @@ void elv_unregister(struct elevator_type *e)
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
} }
spin_lock_irq(&elv_list_lock); spin_lock(&elv_list_lock);
list_del_init(&e->list); list_del_init(&e->list);
spin_unlock_irq(&elv_list_lock); spin_unlock(&elv_list_lock);
} }
EXPORT_SYMBOL_GPL(elv_unregister); EXPORT_SYMBOL_GPL(elv_unregister);
...@@ -1118,7 +1119,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name) ...@@ -1118,7 +1119,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
struct list_head *entry; struct list_head *entry;
int len = 0; int len = 0;
spin_lock_irq(&elv_list_lock); spin_lock(&elv_list_lock);
list_for_each(entry, &elv_list) { list_for_each(entry, &elv_list) {
struct elevator_type *__e; struct elevator_type *__e;
...@@ -1128,7 +1129,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name) ...@@ -1128,7 +1129,7 @@ ssize_t elv_iosched_show(request_queue_t *q, char *name)
else else
len += sprintf(name+len, "%s ", __e->elevator_name); len += sprintf(name+len, "%s ", __e->elevator_name);
} }
spin_unlock_irq(&elv_list_lock); spin_unlock(&elv_list_lock);
len += sprintf(len+name, "\n"); len += sprintf(len+name, "\n");
return len; return len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment