aboutsummaryrefslogtreecommitdiffstats
path: root/block/elevator.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-10-19 15:12:24 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-10-19 15:12:24 -0400
commitf779b7dd3259ec138c7aba793f0602b20262af83 (patch)
tree7ed94961b196c81fcd413e2b04d1e6945d6d227a /block/elevator.c
parent3c00079b31f910309b30ed5c2fd2b7a2d86bba60 (diff)
parentfe0cdec8bad919fd91cd344123906a55f3857209 (diff)
Merge branch 'for-rmk' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into devel-stable
Conflicts: arch/arm/mach-at91/include/mach/system.h arch/arm/mach-imx/mach-cpuimx27.c AT91 conflict resolution: Acked-by: Anders Larsen <al@alarsen.net> IMX conflict resolution confirmed by Uwe Kleine-König.
Diffstat (limited to 'block/elevator.c')
-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)
938 } 938 }
939 } 939 }
940 kobject_uevent(&e->kobj, KOBJ_ADD); 940 kobject_uevent(&e->kobj, KOBJ_ADD);
941 e->registered = 1;
941 } 942 }
942 return error; 943 return error;
943} 944}
@@ -947,6 +948,7 @@ static void __elv_unregister_queue(struct elevator_queue *e)
947{ 948{
948 kobject_uevent(&e->kobj, KOBJ_REMOVE); 949 kobject_uevent(&e->kobj, KOBJ_REMOVE);
949 kobject_del(&e->kobj); 950 kobject_del(&e->kobj);
951 e->registered = 0;
950} 952}
951 953
952void elv_unregister_queue(struct request_queue *q) 954void elv_unregister_queue(struct request_queue *q)
@@ -1042,11 +1044,13 @@ static int elevator_switch(struct request_queue *q, struct elevator_type *new_e)
1042 1044
1043 spin_unlock_irq(q->queue_lock); 1045 spin_unlock_irq(q->queue_lock);
1044 1046
1045 __elv_unregister_queue(old_elevator); 1047 if (old_elevator->registered) {
1048 __elv_unregister_queue(old_elevator);
1046 1049
1047 err = elv_register_queue(q); 1050 err = elv_register_queue(q);
1048 if (err) 1051 if (err)
1049 goto fail_register; 1052 goto fail_register;
1053 }
1050 1054
1051 /* 1055 /*
1052 * finally exit old elevator and turn off BYPASS. 1056 * finally exit old elevator and turn off BYPASS.