[PATCH] sem2mutex: kernel/
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
diff --git a/kernel/module.c b/kernel/module.c
index 77764f2..de6312d 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -39,6 +39,7 @@
#include <linux/device.h>
#include <linux/string.h>
#include <linux/sched.h>
+#include <linux/mutex.h>
#include <asm/uaccess.h>
#include <asm/semaphore.h>
#include <asm/cacheflush.h>
@@ -63,15 +64,15 @@
static DECLARE_MUTEX(module_mutex);
static LIST_HEAD(modules);
-static DECLARE_MUTEX(notify_mutex);
+static DEFINE_MUTEX(notify_mutex);
static struct notifier_block * module_notify_list;
int register_module_notifier(struct notifier_block * nb)
{
int err;
- down(¬ify_mutex);
+ mutex_lock(¬ify_mutex);
err = notifier_chain_register(&module_notify_list, nb);
- up(¬ify_mutex);
+ mutex_unlock(¬ify_mutex);
return err;
}
EXPORT_SYMBOL(register_module_notifier);
@@ -79,9 +80,9 @@
int unregister_module_notifier(struct notifier_block * nb)
{
int err;
- down(¬ify_mutex);
+ mutex_lock(¬ify_mutex);
err = notifier_chain_unregister(&module_notify_list, nb);
- up(¬ify_mutex);
+ mutex_unlock(¬ify_mutex);
return err;
}
EXPORT_SYMBOL(unregister_module_notifier);
@@ -1989,9 +1990,9 @@
/* Drop lock so they can recurse */
up(&module_mutex);
- down(¬ify_mutex);
+ mutex_lock(¬ify_mutex);
notifier_call_chain(&module_notify_list, MODULE_STATE_COMING, mod);
- up(¬ify_mutex);
+ mutex_unlock(¬ify_mutex);
/* Start the module */
if (mod->init != NULL)