diff options
Diffstat (limited to 'kernel/module.c')
| -rw-r--r-- | kernel/module.c | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/kernel/module.c b/kernel/module.c index d8b5605132a0..61d212120df4 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
| @@ -325,18 +325,6 @@ static unsigned long find_symbol(const char *name, | |||
| 325 | return -ENOENT; | 325 | return -ENOENT; |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | /* lookup symbol in given range of kernel_symbols */ | ||
| 329 | static const struct kernel_symbol *lookup_symbol(const char *name, | ||
| 330 | const struct kernel_symbol *start, | ||
| 331 | const struct kernel_symbol *stop) | ||
| 332 | { | ||
| 333 | const struct kernel_symbol *ks = start; | ||
| 334 | for (; ks < stop; ks++) | ||
| 335 | if (strcmp(ks->name, name) == 0) | ||
| 336 | return ks; | ||
| 337 | return NULL; | ||
| 338 | } | ||
| 339 | |||
| 340 | /* Search for module by name: must hold module_mutex. */ | 328 | /* Search for module by name: must hold module_mutex. */ |
| 341 | static struct module *find_module(const char *name) | 329 | static struct module *find_module(const char *name) |
| 342 | { | 330 | { |
| @@ -690,7 +678,7 @@ static int try_stop_module(struct module *mod, int flags, int *forced) | |||
| 690 | if (flags & O_NONBLOCK) { | 678 | if (flags & O_NONBLOCK) { |
| 691 | struct stopref sref = { mod, flags, forced }; | 679 | struct stopref sref = { mod, flags, forced }; |
| 692 | 680 | ||
| 693 | return stop_machine_run(__try_stop_module, &sref, NR_CPUS); | 681 | return stop_machine(__try_stop_module, &sref, NULL); |
| 694 | } else { | 682 | } else { |
| 695 | /* We don't need to stop the machine for this. */ | 683 | /* We don't need to stop the machine for this. */ |
| 696 | mod->state = MODULE_STATE_GOING; | 684 | mod->state = MODULE_STATE_GOING; |
| @@ -1428,7 +1416,7 @@ static int __unlink_module(void *_mod) | |||
| 1428 | static void free_module(struct module *mod) | 1416 | static void free_module(struct module *mod) |
| 1429 | { | 1417 | { |
| 1430 | /* Delete from various lists */ | 1418 | /* Delete from various lists */ |
| 1431 | stop_machine_run(__unlink_module, mod, NR_CPUS); | 1419 | stop_machine(__unlink_module, mod, NULL); |
| 1432 | remove_notes_attrs(mod); | 1420 | remove_notes_attrs(mod); |
| 1433 | remove_sect_attrs(mod); | 1421 | remove_sect_attrs(mod); |
| 1434 | mod_kobject_remove(mod); | 1422 | mod_kobject_remove(mod); |
| @@ -1703,6 +1691,19 @@ static void setup_modinfo(struct module *mod, Elf_Shdr *sechdrs, | |||
| 1703 | } | 1691 | } |
| 1704 | 1692 | ||
| 1705 | #ifdef CONFIG_KALLSYMS | 1693 | #ifdef CONFIG_KALLSYMS |
| 1694 | |||
| 1695 | /* lookup symbol in given range of kernel_symbols */ | ||
| 1696 | static const struct kernel_symbol *lookup_symbol(const char *name, | ||
| 1697 | const struct kernel_symbol *start, | ||
| 1698 | const struct kernel_symbol *stop) | ||
| 1699 | { | ||
| 1700 | const struct kernel_symbol *ks = start; | ||
| 1701 | for (; ks < stop; ks++) | ||
| 1702 | if (strcmp(ks->name, name) == 0) | ||
| 1703 | return ks; | ||
| 1704 | return NULL; | ||
| 1705 | } | ||
| 1706 | |||
| 1706 | static int is_exported(const char *name, const struct module *mod) | 1707 | static int is_exported(const char *name, const struct module *mod) |
| 1707 | { | 1708 | { |
| 1708 | if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab)) | 1709 | if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab)) |
| @@ -2196,7 +2197,7 @@ static struct module *load_module(void __user *umod, | |||
| 2196 | /* Now sew it into the lists so we can get lockdep and oops | 2197 | /* Now sew it into the lists so we can get lockdep and oops |
| 2197 | * info during argument parsing. Noone should access us, since | 2198 | * info during argument parsing. Noone should access us, since |
| 2198 | * strong_try_module_get() will fail. */ | 2199 | * strong_try_module_get() will fail. */ |
| 2199 | stop_machine_run(__link_module, mod, NR_CPUS); | 2200 | stop_machine(__link_module, mod, NULL); |
| 2200 | 2201 | ||
| 2201 | /* Size of section 0 is 0, so this works well if no params */ | 2202 | /* Size of section 0 is 0, so this works well if no params */ |
| 2202 | err = parse_args(mod->name, mod->args, | 2203 | err = parse_args(mod->name, mod->args, |
| @@ -2230,7 +2231,7 @@ static struct module *load_module(void __user *umod, | |||
| 2230 | return mod; | 2231 | return mod; |
| 2231 | 2232 | ||
| 2232 | unlink: | 2233 | unlink: |
| 2233 | stop_machine_run(__unlink_module, mod, NR_CPUS); | 2234 | stop_machine(__unlink_module, mod, NULL); |
| 2234 | module_arch_cleanup(mod); | 2235 | module_arch_cleanup(mod); |
| 2235 | cleanup: | 2236 | cleanup: |
| 2236 | kobject_del(&mod->mkobj.kobj); | 2237 | kobject_del(&mod->mkobj.kobj); |
