mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-09-21 20:21:39 +00:00
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 <jens.axboe@oracle.com>
This commit is contained in:
parent
ffc4e75957
commit
e164094964
1 changed files with 15 additions and 0 deletions
|
@ -134,6 +134,21 @@ static struct elevator_type *elevator_get(const char *name)
|
||||||
spin_lock(&elv_list_lock);
|
spin_lock(&elv_list_lock);
|
||||||
|
|
||||||
e = elevator_find(name);
|
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))
|
if (e && !try_module_get(e->elevator_owner))
|
||||||
e = NULL;
|
e = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue