Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
[BLOCK] elevator: allow default scheduler to potentially be modular
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
typherno authored and Jens Axboe committed Jan 24, 2006
1 parent 5f00397 commit 248d5ca
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions block/elevator.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ int elevator_init(request_queue_t *q, char *name)
if (name && !(e = elevator_get(name)))
return -EINVAL;

if (!e && !(e = elevator_get(chosen_elevator))) {
e = elevator_get(CONFIG_DEFAULT_IOSCHED);
if (*chosen_elevator)
printk("I/O scheduler %s not found\n", chosen_elevator);
if (!e && *chosen_elevator && !(e = elevator_get(chosen_elevator)))
printk("I/O scheduler %s not found\n", chosen_elevator);

if (!e && !(e = elevator_get(CONFIG_DEFAULT_IOSCHED))) {
printk("Default I/O scheduler not found, using no-op\n");
e = elevator_get("noop");
}

eq = kmalloc(sizeof(struct elevator_queue), GFP_KERNEL);
Expand Down

0 comments on commit 248d5ca

Please sign in to comment.