diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-03-23 06:00:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 10:38:10 -0500 |
commit | 97d1f15b7ef52c1e9c28dc48b454024bb53a5fd2 (patch) | |
tree | 7bdb928096eec577e75897351f639d3f94441c87 /kernel/module.c | |
parent | e723ccd805857a46d3b63fbd20edea8579c6c541 (diff) |
[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>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/kernel/module.c b/kernel/module.c index 77764f22f021..de6312da6bb5 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/device.h> | 39 | #include <linux/device.h> |
40 | #include <linux/string.h> | 40 | #include <linux/string.h> |
41 | #include <linux/sched.h> | 41 | #include <linux/sched.h> |
42 | #include <linux/mutex.h> | ||
42 | #include <asm/uaccess.h> | 43 | #include <asm/uaccess.h> |
43 | #include <asm/semaphore.h> | 44 | #include <asm/semaphore.h> |
44 | #include <asm/cacheflush.h> | 45 | #include <asm/cacheflush.h> |
@@ -63,15 +64,15 @@ static DEFINE_SPINLOCK(modlist_lock); | |||
63 | static DECLARE_MUTEX(module_mutex); | 64 | static DECLARE_MUTEX(module_mutex); |
64 | static LIST_HEAD(modules); | 65 | static LIST_HEAD(modules); |
65 | 66 | ||
66 | static DECLARE_MUTEX(notify_mutex); | 67 | static DEFINE_MUTEX(notify_mutex); |
67 | static struct notifier_block * module_notify_list; | 68 | static struct notifier_block * module_notify_list; |
68 | 69 | ||
69 | int register_module_notifier(struct notifier_block * nb) | 70 | int register_module_notifier(struct notifier_block * nb) |
70 | { | 71 | { |
71 | int err; | 72 | int err; |
72 | down(¬ify_mutex); | 73 | mutex_lock(¬ify_mutex); |
73 | err = notifier_chain_register(&module_notify_list, nb); | 74 | err = notifier_chain_register(&module_notify_list, nb); |
74 | up(¬ify_mutex); | 75 | mutex_unlock(¬ify_mutex); |
75 | return err; | 76 | return err; |
76 | } | 77 | } |
77 | EXPORT_SYMBOL(register_module_notifier); | 78 | EXPORT_SYMBOL(register_module_notifier); |
@@ -79,9 +80,9 @@ EXPORT_SYMBOL(register_module_notifier); | |||
79 | int unregister_module_notifier(struct notifier_block * nb) | 80 | int unregister_module_notifier(struct notifier_block * nb) |
80 | { | 81 | { |
81 | int err; | 82 | int err; |
82 | down(¬ify_mutex); | 83 | mutex_lock(¬ify_mutex); |
83 | err = notifier_chain_unregister(&module_notify_list, nb); | 84 | err = notifier_chain_unregister(&module_notify_list, nb); |
84 | up(¬ify_mutex); | 85 | mutex_unlock(¬ify_mutex); |
85 | return err; | 86 | return err; |
86 | } | 87 | } |
87 | EXPORT_SYMBOL(unregister_module_notifier); | 88 | EXPORT_SYMBOL(unregister_module_notifier); |
@@ -1989,9 +1990,9 @@ sys_init_module(void __user *umod, | |||
1989 | /* Drop lock so they can recurse */ | 1990 | /* Drop lock so they can recurse */ |
1990 | up(&module_mutex); | 1991 | up(&module_mutex); |
1991 | 1992 | ||
1992 | down(¬ify_mutex); | 1993 | mutex_lock(¬ify_mutex); |
1993 | notifier_call_chain(&module_notify_list, MODULE_STATE_COMING, mod); | 1994 | notifier_call_chain(&module_notify_list, MODULE_STATE_COMING, mod); |
1994 | up(¬ify_mutex); | 1995 | mutex_unlock(¬ify_mutex); |
1995 | 1996 | ||
1996 | /* Start the module */ | 1997 | /* Start the module */ |
1997 | if (mod->init != NULL) | 1998 | if (mod->init != NULL) |