summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-10-18 01:47:25 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2006-12-04 02:00:22 -0500
commitf6a570333e554b48ad589e7137c77c57809eee81 (patch)
tree68dd6d5c8fe537a19a84a4189202f5cf70925c17 /kernel
parent2b5f6dcce5bf94b9b119e9ed8d537098ec61c3d2 (diff)
downloadop-kernel-dev-f6a570333e554b48ad589e7137c77c57809eee81.zip
op-kernel-dev-f6a570333e554b48ad589e7137c77c57809eee81.tar.gz
[PATCH] severing module.h->sched.h
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/latency.c1
-rw-r--r--kernel/module.c15
2 files changed, 15 insertions, 1 deletions
diff --git a/kernel/latency.c b/kernel/latency.c
index 258f255..e63fcac 100644
--- a/kernel/latency.c
+++ b/kernel/latency.c
@@ -36,6 +36,7 @@
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/notifier.h>
+#include <linux/jiffies.h>
#include <asm/atomic.h>
struct latency_info {
diff --git a/kernel/module.c b/kernel/module.c
index 45e01cb..e2d09d6 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -34,10 +34,10 @@
#include <linux/err.h>
#include <linux/vermagic.h>
#include <linux/notifier.h>
+#include <linux/sched.h>
#include <linux/stop_machine.h>
#include <linux/device.h>
#include <linux/string.h>
-#include <linux/sched.h>
#include <linux/mutex.h>
#include <linux/unwind.h>
#include <asm/uaccess.h>
@@ -790,6 +790,19 @@ static struct module_attribute refcnt = {
.show = show_refcnt,
};
+void module_put(struct module *module)
+{
+ if (module) {
+ unsigned int cpu = get_cpu();
+ local_dec(&module->ref[cpu].count);
+ /* Maybe they're waiting for us to drop reference? */
+ if (unlikely(!module_is_live(module)))
+ wake_up_process(module->waiter);
+ put_cpu();
+ }
+}
+EXPORT_SYMBOL(module_put);
+
#else /* !CONFIG_MODULE_UNLOAD */
static void print_unload_info(struct seq_file *m, struct module *mod)
{
OpenPOWER on IntegriCloud