diff options
author | Daniel Walker <dwalker@mvista.com> | 2008-02-06 04:37:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-06 13:41:08 -0500 |
commit | 6c6080f74c8d83a83a1e36bce803de15c0633898 (patch) | |
tree | fd017cd3697ca30a169572018e88bf628983509b | |
parent | bcf11cbeccd7d981d68567942ba6ec184890bc29 (diff) |
stopmachine: semaphore to mutex
[akpm@linux-foundation.org: cleanup]
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | kernel/stop_machine.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c index 51b5ee53571a..6f4e0e13f70c 100644 --- a/kernel/stop_machine.c +++ b/kernel/stop_machine.c | |||
@@ -29,7 +29,6 @@ enum stopmachine_state { | |||
29 | static enum stopmachine_state stopmachine_state; | 29 | static enum stopmachine_state stopmachine_state; |
30 | static unsigned int stopmachine_num_threads; | 30 | static unsigned int stopmachine_num_threads; |
31 | static atomic_t stopmachine_thread_ack; | 31 | static atomic_t stopmachine_thread_ack; |
32 | static DECLARE_MUTEX(stopmachine_mutex); | ||
33 | 32 | ||
34 | static int stopmachine(void *cpu) | 33 | static int stopmachine(void *cpu) |
35 | { | 34 | { |
@@ -170,6 +169,7 @@ static int do_stop(void *_smdata) | |||
170 | struct task_struct *__stop_machine_run(int (*fn)(void *), void *data, | 169 | struct task_struct *__stop_machine_run(int (*fn)(void *), void *data, |
171 | unsigned int cpu) | 170 | unsigned int cpu) |
172 | { | 171 | { |
172 | static DEFINE_MUTEX(stopmachine_mutex); | ||
173 | struct stop_machine_data smdata; | 173 | struct stop_machine_data smdata; |
174 | struct task_struct *p; | 174 | struct task_struct *p; |
175 | 175 | ||
@@ -177,7 +177,7 @@ struct task_struct *__stop_machine_run(int (*fn)(void *), void *data, | |||
177 | smdata.data = data; | 177 | smdata.data = data; |
178 | init_completion(&smdata.done); | 178 | init_completion(&smdata.done); |
179 | 179 | ||
180 | down(&stopmachine_mutex); | 180 | mutex_lock(&stopmachine_mutex); |
181 | 181 | ||
182 | /* If they don't care which CPU fn runs on, bind to any online one. */ | 182 | /* If they don't care which CPU fn runs on, bind to any online one. */ |
183 | if (cpu == NR_CPUS) | 183 | if (cpu == NR_CPUS) |
@@ -193,7 +193,7 @@ struct task_struct *__stop_machine_run(int (*fn)(void *), void *data, | |||
193 | wake_up_process(p); | 193 | wake_up_process(p); |
194 | wait_for_completion(&smdata.done); | 194 | wait_for_completion(&smdata.done); |
195 | } | 195 | } |
196 | up(&stopmachine_mutex); | 196 | mutex_unlock(&stopmachine_mutex); |
197 | return p; | 197 | return p; |
198 | } | 198 | } |
199 | 199 | ||