Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e164094964e6e20fe7fce418e06a9dce952bb7a4
Commit:     e164094964e6e20fe7fce418e06a9dce952bb7a4
Parent:     ffc4e7595734cf768fa60cea8a4d545dfef8231a
Author:     Jens Axboe <[EMAIL PROTECTED]>
AuthorDate: Tue Feb 19 10:20:37 2008 +0100
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Tue Feb 19 10:20:37 2008 +0100

    elevator: make elevator_get() attempt to load the appropriate module
    
    Currently we fail if someone requests a valid io scheduler, but it's
    modular and not currently loaded. That can happen from a driver init
    asking for a different scheduler, or online switching through sysfs
    as requested by a user.
    
    This patch makes elevator_get() request_module() to attempt to load
    the appropriate module, instead of requiring that done manually.
    
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 block/elevator.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/block/elevator.c b/block/elevator.c
index bafbae0..88318c3 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -134,6 +134,21 @@ static struct elevator_type *elevator_get(const char *name)
        spin_lock(&elv_list_lock);
 
        e = elevator_find(name);
+       if (!e) {
+               char elv[ELV_NAME_MAX + strlen("-iosched")];
+
+               spin_unlock(&elv_list_lock);
+
+               if (!strcmp(name, "anticipatory"))
+                       sprintf(elv, "as-iosched");
+               else
+                       sprintf(elv, "%s-iosched", name);
+
+               request_module(elv);
+               spin_lock(&elv_list_lock);
+               e = elevator_find(name);
+       }
+
        if (e && !try_module_get(e->elevator_owner))
                e = NULL;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to