[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>
This commit is contained in:
committed by
Linus Torvalds
parent
e723ccd805
commit
97d1f15b7e
@@ -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 DEFINE_SPINLOCK(modlist_lock);
|
||||
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 @@ EXPORT_SYMBOL(register_module_notifier);
|
||||
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 @@ sys_init_module(void __user *umod,
|
||||
/* 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)
|
||||
|
Reference in New Issue
Block a user