diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/Kconfig.iosched | 28 | ||||
-rw-r--r-- | drivers/block/as-iosched.c | 2 | ||||
-rw-r--r-- | drivers/block/cciss_scsi.c | 10 | ||||
-rw-r--r-- | drivers/block/cfq-iosched.c | 22 | ||||
-rw-r--r-- | drivers/block/elevator.c | 50 | ||||
-rw-r--r-- | drivers/block/floppy.c | 2 | ||||
-rw-r--r-- | drivers/block/paride/paride.c | 1 | ||||
-rw-r--r-- | drivers/block/paride/pf.c | 4 | ||||
-rw-r--r-- | drivers/block/paride/pg.c | 2 | ||||
-rw-r--r-- | drivers/block/paride/pt.c | 1 | ||||
-rw-r--r-- | drivers/block/viodasd.c | 9 |
11 files changed, 81 insertions, 50 deletions
diff --git a/drivers/block/Kconfig.iosched b/drivers/block/Kconfig.iosched index 6070a48..5b90d2f 100644 --- a/drivers/block/Kconfig.iosched +++ b/drivers/block/Kconfig.iosched @@ -38,4 +38,32 @@ config IOSCHED_CFQ among all processes in the system. It should provide a fair working environment, suitable for desktop systems. +choice + prompt "Default I/O scheduler" + default DEFAULT_AS + help + Select the I/O scheduler which will be used by default for all + block devices. + + config DEFAULT_AS + bool "Anticipatory" if IOSCHED_AS + + config DEFAULT_DEADLINE + bool "Deadline" if IOSCHED_DEADLINE + + config DEFAULT_CFQ + bool "CFQ" if IOSCHED_CFQ + + config DEFAULT_NOOP + bool "No-op" + +endchoice + +config DEFAULT_IOSCHED + string + default "anticipatory" if DEFAULT_AS + default "deadline" if DEFAULT_DEADLINE + default "cfq" if DEFAULT_CFQ + default "noop" if DEFAULT_NOOP + endmenu diff --git a/drivers/block/as-iosched.c b/drivers/block/as-iosched.c index 5641722..c6744ff 100644 --- a/drivers/block/as-iosched.c +++ b/drivers/block/as-iosched.c @@ -1973,8 +1973,8 @@ static int __init as_init(void) static void __exit as_exit(void) { - kmem_cache_destroy(arq_pool); elv_unregister(&iosched_as); + kmem_cache_destroy(arq_pool); } module_init(as_init); diff --git a/drivers/block/cciss_scsi.c b/drivers/block/cciss_scsi.c index e183a3e..ec27976 100644 --- a/drivers/block/cciss_scsi.c +++ b/drivers/block/cciss_scsi.c @@ -28,13 +28,17 @@ through the array controller. Note in particular, neither physical nor logical disks are presented through the scsi layer. */ +#include <linux/timer.h> +#include <linux/completion.h> +#include <linux/slab.h> +#include <linux/string.h> + +#include <asm/atomic.h> + #include <scsi/scsi.h> #include <scsi/scsi_cmnd.h> #include <scsi/scsi_device.h> #include <scsi/scsi_host.h> -#include <asm/atomic.h> -#include <linux/timer.h> -#include <linux/completion.h> #include "cciss_scsi.h" diff --git a/drivers/block/cfq-iosched.c b/drivers/block/cfq-iosched.c index 94690e4..5281f8e 100644 --- a/drivers/block/cfq-iosched.c +++ b/drivers/block/cfq-iosched.c @@ -2418,28 +2418,8 @@ static int __init cfq_init(void) static void __exit cfq_exit(void) { - struct task_struct *g, *p; - unsigned long flags; - - read_lock_irqsave(&tasklist_lock, flags); - - /* - * iterate each process in the system, removing our io_context - */ - do_each_thread(g, p) { - struct io_context *ioc = p->io_context; - - if (ioc && ioc->cic) { - ioc->cic->exit(ioc->cic); - cfq_free_io_context(ioc->cic); - ioc->cic = NULL; - } - } while_each_thread(g, p); - - read_unlock_irqrestore(&tasklist_lock, flags); - - cfq_slab_kill(); elv_unregister(&iosched_cfq); + cfq_slab_kill(); } module_init(cfq_init); diff --git a/drivers/block/elevator.c b/drivers/block/elevator.c index 55621d5..36f1057 100644 --- a/drivers/block/elevator.c +++ b/drivers/block/elevator.c @@ -147,24 +147,17 @@ static void elevator_setup_default(void) struct elevator_type *e; /* - * check if default is set and exists + * If default has not been set, use the compiled-in selection. */ - if (chosen_elevator[0] && (e = elevator_get(chosen_elevator))) { - elevator_put(e); - return; - } + if (!chosen_elevator[0]) + strcpy(chosen_elevator, CONFIG_DEFAULT_IOSCHED); -#if defined(CONFIG_IOSCHED_AS) - strcpy(chosen_elevator, "anticipatory"); -#elif defined(CONFIG_IOSCHED_DEADLINE) - strcpy(chosen_elevator, "deadline"); -#elif defined(CONFIG_IOSCHED_CFQ) - strcpy(chosen_elevator, "cfq"); -#elif defined(CONFIG_IOSCHED_NOOP) - strcpy(chosen_elevator, "noop"); -#else -#error "You must build at least 1 IO scheduler into the kernel" -#endif + /* + * If the given scheduler is not available, fall back to no-op. + */ + if (!(e = elevator_find(chosen_elevator))) + strcpy(chosen_elevator, "noop"); + elevator_put(e); } static int __init elevator_setup(char *str) @@ -642,6 +635,27 @@ EXPORT_SYMBOL_GPL(elv_register); void elv_unregister(struct elevator_type *e) { + struct task_struct *g, *p; + + /* + * Iterate every thread in the process to remove the io contexts. + */ + read_lock(&tasklist_lock); + do_each_thread(g, p) { + struct io_context *ioc = p->io_context; + if (ioc && ioc->cic) { + ioc->cic->exit(ioc->cic); + ioc->cic->dtor(ioc->cic); + ioc->cic = NULL; + } + if (ioc && ioc->aic) { + ioc->aic->exit(ioc->aic); + ioc->aic->dtor(ioc->aic); + ioc->aic = NULL; + } + } while_each_thread(g, p); + read_unlock(&tasklist_lock); + spin_lock_irq(&elv_list_lock); list_del_init(&e->list); spin_unlock_irq(&elv_list_lock); @@ -739,8 +753,10 @@ ssize_t elv_iosched_store(request_queue_t *q, const char *name, size_t count) return -EINVAL; } - if (!strcmp(elevator_name, q->elevator->elevator_type->elevator_name)) + if (!strcmp(elevator_name, q->elevator->elevator_type->elevator_name)) { + elevator_put(e); return count; + } elevator_switch(q, e); return count; diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 0089547..5eadbb9 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -177,7 +177,7 @@ static int print_unex = 1; #include <linux/interrupt.h> #include <linux/init.h> #include <linux/devfs_fs_kernel.h> -#include <linux/device.h> +#include <linux/platform_device.h> #include <linux/buffer_head.h> /* for invalidate_buffers() */ /* diff --git a/drivers/block/paride/paride.c b/drivers/block/paride/paride.c index 1fef136..ce94aa1 100644 --- a/drivers/block/paride/paride.c +++ b/drivers/block/paride/paride.c @@ -29,6 +29,7 @@ #include <linux/string.h> #include <linux/spinlock.h> #include <linux/wait.h> +#include <linux/sched.h> /* TASK_* */ #ifdef CONFIG_PARPORT_MODULE #define CONFIG_PARPORT diff --git a/drivers/block/paride/pf.c b/drivers/block/paride/pf.c index 94af920..e9746af2 100644 --- a/drivers/block/paride/pf.c +++ b/drivers/block/paride/pf.c @@ -807,10 +807,6 @@ static int pf_next_buf(void) return 1; spin_lock_irqsave(&pf_spin_lock, saved_flags); pf_end_request(1); - if (pf_req) { - pf_count = pf_req->current_nr_sectors; - pf_buf = pf_req->buffer; - } spin_unlock_irqrestore(&pf_spin_lock, saved_flags); return 1; } diff --git a/drivers/block/paride/pg.c b/drivers/block/paride/pg.c index 82f2d6d..6f5df0f 100644 --- a/drivers/block/paride/pg.c +++ b/drivers/block/paride/pg.c @@ -162,6 +162,8 @@ enum {D_PRT, D_PRO, D_UNI, D_MOD, D_SLV, D_DLY}; #include <linux/mtio.h> #include <linux/pg.h> #include <linux/device.h> +#include <linux/sched.h> /* current, TASK_* */ +#include <linux/jiffies.h> #include <asm/uaccess.h> diff --git a/drivers/block/paride/pt.c b/drivers/block/paride/pt.c index 686c955..715ae5d 100644 --- a/drivers/block/paride/pt.c +++ b/drivers/block/paride/pt.c @@ -146,6 +146,7 @@ static int (*drives[4])[6] = {&drive0, &drive1, &drive2, &drive3}; #include <linux/slab.h> #include <linux/mtio.h> #include <linux/device.h> +#include <linux/sched.h> /* current, TASK_*, schedule_timeout() */ #include <asm/uaccess.h> diff --git a/drivers/block/viodasd.c b/drivers/block/viodasd.c index e46ecd2..709f809 100644 --- a/drivers/block/viodasd.c +++ b/drivers/block/viodasd.c @@ -778,13 +778,16 @@ static struct vio_device_id viodasd_device_table[] __devinitdata = { { "viodasd", "" }, { "", "" } }; - MODULE_DEVICE_TABLE(vio, viodasd_device_table); + static struct vio_driver viodasd_driver = { - .name = "viodasd", .id_table = viodasd_device_table, .probe = viodasd_probe, - .remove = viodasd_remove + .remove = viodasd_remove, + .driver = { + .name = "viodasd", + .owner = THIS_MODULE, + } }; /* |