diff options
| author | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-04 13:37:06 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-04 13:37:06 -0500 |
| commit | 9b8ab9f6c37c610feea20edfb357a3b8a43d39bd (patch) | |
| tree | 02d18c920a03a600e915d66d6a471d900857b3ac /kernel/module.c | |
| parent | 12472b4165a21f5415ff4f60f8f46311a6b7b9ac (diff) | |
| parent | f23f6e08c47acbdd20e9c49a79da8c404ea168e1 (diff) | |
Merge branch 'for-linus4' of master.kernel.org:/pub/scm/linux/kernel/git/viro/bird
* 'for-linus4' of master.kernel.org:/pub/scm/linux/kernel/git/viro/bird:
[PATCH] severing poll.h -> mm.h
[PATCH] severing skbuff.h -> mm.h
[PATCH] severing skbuff.h -> poll.h
[PATCH] severing skbuff.h -> highmem.h
[PATCH] severing uaccess.h -> sched.h
[PATCH] severing fs.h, radix-tree.h -> sched.h
[PATCH] severing module.h->sched.h
Diffstat (limited to 'kernel/module.c')
| -rw-r--r-- | kernel/module.c | 15 |
1 files changed, 14 insertions, 1 deletions
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 | { |
