diff options
author | Colin Cross <ccross@android.com> | 2010-10-15 12:04:05 -0700 |
---|---|---|
committer | Colin Cross <ccross@android.com> | 2010-10-15 12:04:05 -0700 |
commit | 9ab3d8b9fcc83cb2eab5cc9834b742d437915a2e (patch) | |
tree | 0a4dc68f031cba95cd36ededfb9b30de60fe1145 /block | |
parent | c8b43bb8ec47fc7e75f4474b454d459a22d9f233 (diff) | |
parent | 89c37cce1c850fe046df50ccb923a8eccbf259b6 (diff) |
Merge branch 'linux-tegra-2.6.36' into android-tegra-2.6.36
Diffstat (limited to 'block')
-rw-r--r-- | block/elevator.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/block/elevator.c b/block/elevator.c index 205b09a5bd9e..4e11559aa2b0 100644 --- a/block/elevator.c +++ b/block/elevator.c @@ -938,6 +938,7 @@ int elv_register_queue(struct request_queue *q) } } kobject_uevent(&e->kobj, KOBJ_ADD); + e->registered = 1; } return error; } @@ -947,6 +948,7 @@ static void __elv_unregister_queue(struct elevator_queue *e) { kobject_uevent(&e->kobj, KOBJ_REMOVE); kobject_del(&e->kobj); + e->registered = 0; } void elv_unregister_queue(struct request_queue *q) @@ -1042,11 +1044,13 @@ static int elevator_switch(struct request_queue *q, struct elevator_type *new_e) spin_unlock_irq(q->queue_lock); - __elv_unregister_queue(old_elevator); + if (old_elevator->registered) { + __elv_unregister_queue(old_elevator); - err = elv_register_queue(q); - if (err) - goto fail_register; + err = elv_register_queue(q); + if (err) + goto fail_register; + } /* * finally exit old elevator and turn off BYPASS. |