diff options
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/kernel/module.c b/kernel/module.c index 1016b75b026a..3c4fc4bb4b82 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -59,8 +59,6 @@ | |||
59 | #define CREATE_TRACE_POINTS | 59 | #define CREATE_TRACE_POINTS |
60 | #include <trace/events/module.h> | 60 | #include <trace/events/module.h> |
61 | 61 | ||
62 | EXPORT_TRACEPOINT_SYMBOL(module_get); | ||
63 | |||
64 | #if 0 | 62 | #if 0 |
65 | #define DEBUGP printk | 63 | #define DEBUGP printk |
66 | #else | 64 | #else |
@@ -79,6 +77,10 @@ EXPORT_TRACEPOINT_SYMBOL(module_get); | |||
79 | DEFINE_MUTEX(module_mutex); | 77 | DEFINE_MUTEX(module_mutex); |
80 | EXPORT_SYMBOL_GPL(module_mutex); | 78 | EXPORT_SYMBOL_GPL(module_mutex); |
81 | static LIST_HEAD(modules); | 79 | static LIST_HEAD(modules); |
80 | #ifdef CONFIG_KGDB_KDB | ||
81 | struct list_head *kdb_modules = &modules; /* kdb needs the list of modules */ | ||
82 | #endif /* CONFIG_KGDB_KDB */ | ||
83 | |||
82 | 84 | ||
83 | /* Block module loading/unloading? */ | 85 | /* Block module loading/unloading? */ |
84 | int modules_disabled = 0; | 86 | int modules_disabled = 0; |
@@ -515,6 +517,9 @@ MODINFO_ATTR(srcversion); | |||
515 | static char last_unloaded_module[MODULE_NAME_LEN+1]; | 517 | static char last_unloaded_module[MODULE_NAME_LEN+1]; |
516 | 518 | ||
517 | #ifdef CONFIG_MODULE_UNLOAD | 519 | #ifdef CONFIG_MODULE_UNLOAD |
520 | |||
521 | EXPORT_TRACEPOINT_SYMBOL(module_get); | ||
522 | |||
518 | /* Init the unload section of the module. */ | 523 | /* Init the unload section of the module. */ |
519 | static void module_unload_init(struct module *mod) | 524 | static void module_unload_init(struct module *mod) |
520 | { | 525 | { |
@@ -723,16 +728,8 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, | |||
723 | return -EFAULT; | 728 | return -EFAULT; |
724 | name[MODULE_NAME_LEN-1] = '\0'; | 729 | name[MODULE_NAME_LEN-1] = '\0'; |
725 | 730 | ||
726 | /* Create stop_machine threads since free_module relies on | 731 | if (mutex_lock_interruptible(&module_mutex) != 0) |
727 | * a non-failing stop_machine call. */ | 732 | return -EINTR; |
728 | ret = stop_machine_create(); | ||
729 | if (ret) | ||
730 | return ret; | ||
731 | |||
732 | if (mutex_lock_interruptible(&module_mutex) != 0) { | ||
733 | ret = -EINTR; | ||
734 | goto out_stop; | ||
735 | } | ||
736 | 733 | ||
737 | mod = find_module(name); | 734 | mod = find_module(name); |
738 | if (!mod) { | 735 | if (!mod) { |
@@ -792,8 +789,6 @@ SYSCALL_DEFINE2(delete_module, const char __user *, name_user, | |||
792 | 789 | ||
793 | out: | 790 | out: |
794 | mutex_unlock(&module_mutex); | 791 | mutex_unlock(&module_mutex); |
795 | out_stop: | ||
796 | stop_machine_destroy(); | ||
797 | return ret; | 792 | return ret; |
798 | } | 793 | } |
799 | 794 | ||
@@ -867,8 +862,7 @@ void module_put(struct module *module) | |||
867 | smp_wmb(); /* see comment in module_refcount */ | 862 | smp_wmb(); /* see comment in module_refcount */ |
868 | __this_cpu_inc(module->refptr->decs); | 863 | __this_cpu_inc(module->refptr->decs); |
869 | 864 | ||
870 | trace_module_put(module, _RET_IP_, | 865 | trace_module_put(module, _RET_IP_); |
871 | __this_cpu_read(module->refptr->decs)); | ||
872 | /* Maybe they're waiting for us to drop reference? */ | 866 | /* Maybe they're waiting for us to drop reference? */ |
873 | if (unlikely(!module_is_live(module))) | 867 | if (unlikely(!module_is_live(module))) |
874 | wake_up_process(module->waiter); | 868 | wake_up_process(module->waiter); |
@@ -1192,7 +1186,7 @@ struct module_notes_attrs { | |||
1192 | struct bin_attribute attrs[0]; | 1186 | struct bin_attribute attrs[0]; |
1193 | }; | 1187 | }; |
1194 | 1188 | ||
1195 | static ssize_t module_notes_read(struct kobject *kobj, | 1189 | static ssize_t module_notes_read(struct file *filp, struct kobject *kobj, |
1196 | struct bin_attribute *bin_attr, | 1190 | struct bin_attribute *bin_attr, |
1197 | char *buf, loff_t pos, size_t count) | 1191 | char *buf, loff_t pos, size_t count) |
1198 | { | 1192 | { |