diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/latency.c | 1 | ||||
-rw-r--r-- | kernel/module.c | 15 |
2 files changed, 15 insertions, 1 deletions
diff --git a/kernel/latency.c b/kernel/latency.c index 258f2555abbc..e63fcacb61a7 100644 --- a/kernel/latency.c +++ b/kernel/latency.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/slab.h> | 36 | #include <linux/slab.h> |
37 | #include <linux/module.h> | 37 | #include <linux/module.h> |
38 | #include <linux/notifier.h> | 38 | #include <linux/notifier.h> |
39 | #include <linux/jiffies.h> | ||
39 | #include <asm/atomic.h> | 40 | #include <asm/atomic.h> |
40 | 41 | ||
41 | struct latency_info { | 42 | struct latency_info { |
diff --git a/kernel/module.c b/kernel/module.c index 45e01cb60101..e2d09d604ca0 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -34,10 +34,10 @@ | |||
34 | #include <linux/err.h> | 34 | #include <linux/err.h> |
35 | #include <linux/vermagic.h> | 35 | #include <linux/vermagic.h> |
36 | #include <linux/notifier.h> | 36 | #include <linux/notifier.h> |
37 | #include <linux/sched.h> | ||
37 | #include <linux/stop_machine.h> | 38 | #include <linux/stop_machine.h> |
38 | #include <linux/device.h> | 39 | #include <linux/device.h> |
39 | #include <linux/string.h> | 40 | #include <linux/string.h> |
40 | #include <linux/sched.h> | ||
41 | #include <linux/mutex.h> | 41 | #include <linux/mutex.h> |
42 | #include <linux/unwind.h> | 42 | #include <linux/unwind.h> |
43 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
@@ -790,6 +790,19 @@ static struct module_attribute refcnt = { | |||
790 | .show = show_refcnt, | 790 | .show = show_refcnt, |
791 | }; | 791 | }; |
792 | 792 | ||
793 | void module_put(struct module *module) | ||
794 | { | ||
795 | if (module) { | ||
796 | unsigned int cpu = get_cpu(); | ||
797 | local_dec(&module->ref[cpu].count); | ||
798 | /* Maybe they're waiting for us to drop reference? */ | ||
799 | if (unlikely(!module_is_live(module))) | ||
800 | wake_up_process(module->waiter); | ||
801 | put_cpu(); | ||
802 | } | ||
803 | } | ||
804 | EXPORT_SYMBOL(module_put); | ||
805 | |||
793 | #else /* !CONFIG_MODULE_UNLOAD */ | 806 | #else /* !CONFIG_MODULE_UNLOAD */ |
794 | static void print_unload_info(struct seq_file *m, struct module *mod) | 807 | static void print_unload_info(struct seq_file *m, struct module *mod) |
795 | { | 808 | { |