diff options
author | Nate Diller <nate@namesys.com> | 2005-10-30 18:02:19 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-10-30 20:37:20 -0500 |
commit | 131dda7f8965a6b794dcde1d84f3ba5951a4d641 (patch) | |
tree | 604154c55cf0077b128ddb15d7bb99c0bccad4ce /drivers/block/elevator.c | |
parent | 6dd69f1061bfdeca230509b173438e0731bff767 (diff) |
[PATCH] block cleanups: Add kconfig default iosched submenu
Add a kconfig submenu to select the default I/O scheduler, in case
anticipatory is not compiled in or another default is preferred. Also,
since no-op is always available, we should use it whenever the selected
default is not.
Signed-off-by: Nate Diller <nate@namesys.com>
Acked-by: Jens Axboe <axboe@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/block/elevator.c')
-rw-r--r-- | drivers/block/elevator.c | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c index 58e881bfd189..3b652eba2d20 100644 --- a/drivers/block/elevator.c +++ b/drivers/block/elevator.c | |||
@@ -147,24 +147,17 @@ static void elevator_setup_default(void) | |||
147 | struct elevator_type *e; | 147 | struct elevator_type *e; |
148 | 148 | ||
149 | /* | 149 | /* |
150 | * check if default is set and exists | 150 | * If default has not been set, use the compiled-in selection. |
151 | */ | 151 | */ |
152 | if (chosen_elevator[0] && (e = elevator_get(chosen_elevator))) { | 152 | if (!chosen_elevator[0]) |
153 | elevator_put(e); | 153 | strcpy(chosen_elevator, CONFIG_DEFAULT_IOSCHED); |
154 | return; | 154 | |
155 | } | 155 | /* |
156 | 156 | * If the given scheduler is not available, fall back to no-op. | |
157 | #if defined(CONFIG_IOSCHED_AS) | 157 | */ |
158 | strcpy(chosen_elevator, "anticipatory"); | 158 | if (!(e = elevator_find(chosen_elevator))) |
159 | #elif defined(CONFIG_IOSCHED_DEADLINE) | 159 | strcpy(chosen_elevator, "noop"); |
160 | strcpy(chosen_elevator, "deadline"); | 160 | elevator_put(e); |
161 | #elif defined(CONFIG_IOSCHED_CFQ) | ||
162 | strcpy(chosen_elevator, "cfq"); | ||
163 | #elif defined(CONFIG_IOSCHED_NOOP) | ||
164 | strcpy(chosen_elevator, "noop"); | ||
165 | #else | ||
166 | #error "You must build at least 1 IO scheduler into the kernel" | ||
167 | #endif | ||
168 | } | 161 | } |
169 | 162 | ||
170 | static int __init elevator_setup(char *str) | 163 | static int __init elevator_setup(char *str) |