aboutsummaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorNate Diller <nate.diller@gmail.com>2006-01-24 04:09:14 -0500
committerJens Axboe <axboe@suse.de>2006-01-24 04:09:14 -0500
commit248d5ca5ed5feb7f1a68d213c0ff89c604a97179 (patch)
treebf05775c34c326d11ec7789ba71071755032783d /block
parent5f00397644e01adfbebafb5d0ebc01eba522709d (diff)
[BLOCK] elevator: allow default scheduler to potentially be modular
Jens has decided that allowing the default scheduler to be a module is a bug, and should not be allowed under kconfig. However, I find that scenario useful for debugging, and wish for the kernel to be able to handle this situation without OOPSing, if I enable such an option in the .config directly. This patch dynamically checks for the presence of the compiled-in default, and falls back to no-op, emitting a suitable error message, when the default is not available Tested for a range of boot options on 2.6.16-rc1-mm2. Signed-off-by: Nate Diller <nate.diller@gmail.com> Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'block')
-rw-r--r--block/elevator.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/block/elevator.c b/block/elevator.c
index dbbea73a8b10..96a61e029ce5 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -168,10 +168,12 @@ int elevator_init(request_queue_t *q, char *name)
168 if (name && !(e = elevator_get(name))) 168 if (name && !(e = elevator_get(name)))
169 return -EINVAL; 169 return -EINVAL;
170 170
171 if (!e && !(e = elevator_get(chosen_elevator))) { 171 if (!e && *chosen_elevator && !(e = elevator_get(chosen_elevator)))
172 e = elevator_get(CONFIG_DEFAULT_IOSCHED); 172 printk("I/O scheduler %s not found\n", chosen_elevator);
173 if (*chosen_elevator) 173
174 printk("I/O scheduler %s not found\n", chosen_elevator); 174 if (!e && !(e = elevator_get(CONFIG_DEFAULT_IOSCHED))) {
175 printk("Default I/O scheduler not found, using no-op\n");
176 e = elevator_get("noop");
175 } 177 }
176 178
177 eq = kmalloc(sizeof(struct elevator_queue), GFP_KERNEL); 179 eq = kmalloc(sizeof(struct elevator_queue), GFP_KERNEL);