linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Walker <dwalker@mvista.com>
To: akpm@linux-foundation.org
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org, linux@bohmer.net,
	jonathan@jonmasters.org, matthias.kaehlcke@gmail.com
Subject: [PATCH 1/3] stopmachine semaphore to mutex
Date: Wed, 05 Dec 2007 00:00:01 -0800	[thread overview]
Message-ID: <20071206021906.632232033@mvista.com> (raw)
Message-ID: <20071206021857.826386004@mvista.com> (raw)

[-- Attachment #1: stopmachine_semaphore_to_mutex.patch --]
[-- Type: text/plain, Size: 1213 bytes --]

It's called stopmachine_mutex now, but it's a semaphore. So make it
a "struct mutex" .

Signed-off-by: Daniel Walker <dwalker@mvista.com>

---
 kernel/stop_machine.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: linux-2.6.23/kernel/stop_machine.c
===================================================================
--- linux-2.6.23.orig/kernel/stop_machine.c
+++ linux-2.6.23/kernel/stop_machine.c
@@ -29,7 +29,7 @@ enum stopmachine_state {
 static enum stopmachine_state stopmachine_state;
 static unsigned int stopmachine_num_threads;
 static atomic_t stopmachine_thread_ack;
-static DECLARE_MUTEX(stopmachine_mutex);
+static DEFINE_MUTEX(stopmachine_mutex);
 
 static int stopmachine(void *cpu)
 {
@@ -177,7 +177,7 @@ struct task_struct *__stop_machine_run(i
 	smdata.data = data;
 	init_completion(&smdata.done);
 
-	down(&stopmachine_mutex);
+	mutex_lock(&stopmachine_mutex);
 
 	/* If they don't care which CPU fn runs on, bind to any online one. */
 	if (cpu == NR_CPUS)
@@ -193,7 +193,7 @@ struct task_struct *__stop_machine_run(i
 		wake_up_process(p);
 		wait_for_completion(&smdata.done);
 	}
-	up(&stopmachine_mutex);
+	mutex_unlock(&stopmachine_mutex);
 	return p;
 }
 

-- 

             reply	other threads:[~2007-12-06  2:31 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20071206021857.826386004@mvista.com>
2007-12-05  8:00 ` Daniel Walker [this message]
2007-12-05  8:00 ` [PATCH 2/3] Amiga serial driver: port_write_mutex fixup Daniel Walker
2007-12-05  8:00 ` [PATCH 3/3] printer port driver: semaphore to mutex Daniel Walker
2007-12-06 10:23   ` Ingo Molnar
2007-12-06 16:34     ` Daniel Walker
2007-12-06 20:01       ` Remy Bohmer
2007-12-06 20:12         ` Daniel Walker
2007-12-06 20:40           ` Remy Bohmer
2007-12-06 20:05       ` Matthias Kaehlcke
2007-12-06 20:12         ` Remy Bohmer
2007-12-06 20:23           ` Daniel Walker
2007-12-07  7:40           ` Matthias Kaehlcke
2007-12-06 20:44       ` Ingo Molnar
2007-12-06 23:30       ` Kevin Winchester
2007-12-07  1:05         ` Daniel Walker
2007-12-07  1:29           ` Possible locking issue in viotape.c Kevin Winchester
2007-12-07  1:40             ` Daniel Walker
2007-12-08 18:17               ` Kevin Winchester
2007-12-08 18:22                 ` Daniel Walker
2007-12-08 19:19                   ` Kevin Winchester
2007-12-08 19:45                     ` Daniel Walker
2007-12-06 10:22 ` [PATCH 1/3] stopmachine semaphore to mutex Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071206021906.632232033@mvista.com \
    --to=dwalker@mvista.com \
    --cc=akpm@linux-foundation.org \
    --cc=jonathan@jonmasters.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@bohmer.net \
    --cc=matthias.kaehlcke@gmail.com \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).