summaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2010-10-15 12:04:05 -0700
committerColin Cross <ccross@android.com>2010-10-15 12:04:05 -0700
commit9ab3d8b9fcc83cb2eab5cc9834b742d437915a2e (patch)
tree0a4dc68f031cba95cd36ededfb9b30de60fe1145 /block
parentc8b43bb8ec47fc7e75f4474b454d459a22d9f233 (diff)
parent89c37cce1c850fe046df50ccb923a8eccbf259b6 (diff)
Merge branch 'linux-tegra-2.6.36' into android-tegra-2.6.36
Diffstat (limited to 'block')
-rw-r--r--block/elevator.c12
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.