From: Daniel Walker <dwalker@mvista.com>
To: akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, linux@bohmer.net,
jonathan@jonmasters.org, matthias.kaehlcke@gmail.com,
kjwinchester@gmail.com
Subject: [PATCH 3/4] mcheck mce_64: mce_read_sem to mutex
Date: Fri, 07 Dec 2007 00:00:03 -0800 [thread overview]
Message-ID: <20071208025623.144225546@mvista.com> (raw)
In-Reply-To: 20071208025608.631609481@mvista.com
[-- Attachment #1: mcheck_semaphore-to-mutex.patch --]
[-- Type: text/plain, Size: 1336 bytes --]
Converted to a mutex, and changed the name to mce_read_mutex.
Signed-off-by: Daniel Walker <dwalker@mvista.com>
---
arch/x86/kernel/cpu/mcheck/mce_64.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Index: linux-2.6.23/arch/x86/kernel/cpu/mcheck/mce_64.c
===================================================================
--- linux-2.6.23.orig/arch/x86/kernel/cpu/mcheck/mce_64.c
+++ linux-2.6.23/arch/x86/kernel/cpu/mcheck/mce_64.c
@@ -564,7 +564,7 @@ static ssize_t mce_read(struct file *fil
loff_t *off)
{
unsigned long *cpu_tsc;
- static DECLARE_MUTEX(mce_read_sem);
+ static DEFINE_MUTEX(mce_read_mutex);
unsigned next;
char __user *buf = ubuf;
int i, err;
@@ -573,12 +573,12 @@ static ssize_t mce_read(struct file *fil
if (!cpu_tsc)
return -ENOMEM;
- down(&mce_read_sem);
+ mutex_lock(&mce_read_mutex);
next = rcu_dereference(mcelog.next);
/* Only supports full reads right now */
if (*off != 0 || usize < MCE_LOG_LEN*sizeof(struct mce)) {
- up(&mce_read_sem);
+ mutex_unlock(&mce_read_mutex);
kfree(cpu_tsc);
return -EINVAL;
}
@@ -621,7 +621,7 @@ static ssize_t mce_read(struct file *fil
memset(&mcelog.entry[i], 0, sizeof(struct mce));
}
}
- up(&mce_read_sem);
+ mutex_unlock(&mce_read_mutex);
kfree(cpu_tsc);
return err ? -EFAULT : buf - ubuf;
}
--
next prev parent reply other threads:[~2007-12-08 3:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20071208025608.631609481@mvista.com>
2007-12-07 8:00 ` [PATCH 1/4] media: video: usbvision: remove ctrlUrbLock Daniel Walker
2007-12-07 8:00 ` [PATCH 2/4] docs: kernel-locking: Convert semaphore references Daniel Walker
2007-12-07 8:00 ` Daniel Walker [this message]
2007-12-07 8:00 ` [PATCH 4/4] md: dm driver: suspend_lock semaphore to mutex Daniel Walker
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=20071208025623.144225546@mvista.com \
--to=dwalker@mvista.com \
--cc=akpm@linux-foundation.org \
--cc=jonathan@jonmasters.org \
--cc=kjwinchester@gmail.com \
--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