From: Jeff Dike <jdike@addtoit.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Daniel Walker <dwalker@mvista.com>,
uml-devel <user-mode-linux-devel@lists.sourceforge.net>,
LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 18/20] UML - mconsole mutex conversion
Date: Thu, 17 Jan 2008 16:40:49 -0500 [thread overview]
Message-ID: <20080117214049.GA6777@c2.user-mode-linux.org> (raw)
From: Daniel Walker <dwalker@mvista.com>
The plug_mem_mutex is already used as a mutex since it's using DECLARE_MUTEX(),
but the underlying construct is still a semaphore .. This patch switches
it over to a struct mutex.
Signed-off-by: Daniel Walker <dwalker@mvista.com>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
---
arch/um/drivers/mconsole_kern.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
Index: linux-2.6-git/arch/um/drivers/mconsole_kern.c
===================================================================
--- linux-2.6-git.orig/arch/um/drivers/mconsole_kern.c 2008-01-17 14:35:43.000000000 -0500
+++ linux-2.6-git/arch/um/drivers/mconsole_kern.c 2008-01-17 14:37:29.000000000 -0500
@@ -17,6 +17,7 @@
#include "linux/syscalls.h"
#include "linux/utsname.h"
#include "linux/workqueue.h"
+#include "linux/mutex.h"
#include "asm/uaccess.h"
#include "init.h"
#include "irq_kern.h"
@@ -360,7 +361,7 @@ struct unplugged_pages {
void *pages[UNPLUGGED_PER_PAGE];
};
-static DECLARE_MUTEX(plug_mem_mutex);
+static DEFINE_MUTEX(plug_mem_mutex);
static unsigned long long unplugged_pages_count = 0;
static LIST_HEAD(unplugged_pages);
static int unplug_index = UNPLUGGED_PER_PAGE;
@@ -396,7 +397,7 @@ static int mem_config(char *str, char **
diff /= PAGE_SIZE;
- down(&plug_mem_mutex);
+ mutex_lock(&plug_mem_mutex);
for (i = 0; i < diff; i++) {
struct unplugged_pages *unplugged;
void *addr;
@@ -453,7 +454,7 @@ static int mem_config(char *str, char **
err = 0;
out_unlock:
- up(&plug_mem_mutex);
+ mutex_unlock(&plug_mem_mutex);
out:
return err;
}
reply other threads:[~2008-01-17 21:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20080117214049.GA6777@c2.user-mode-linux.org \
--to=jdike@addtoit.com \
--cc=akpm@osdl.org \
--cc=dwalker@mvista.com \
--cc=linux-kernel@vger.kernel.org \
--cc=user-mode-linux-devel@lists.sourceforge.net \
/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