Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2aa9c5db8e1eadf12a6c938dbd3e39ba6b923b8c Commit: 2aa9c5db8e1eadf12a6c938dbd3e39ba6b923b8c Parent: e98fa28160eabdcda4c4c5bf7af7a3256c10c922 Author: Daniel Walker <[EMAIL PROTECTED]> AuthorDate: Mon Feb 4 22:31:27 2008 -0800 Committer: Linus Torvalds <[EMAIL PROTECTED]> CommitDate: Tue Feb 5 09:44:32 2008 -0800
uml: port mutex conversion The port_sem 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 <[EMAIL PROTECTED]> Signed-off-by: Jeff Dike <[EMAIL PROTECTED]> Signed-off-by: Andrew Morton <[EMAIL PROTECTED]> Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]> --- arch/um/drivers/port_kern.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/um/drivers/port_kern.c b/arch/um/drivers/port_kern.c index 330543b..1993008 100644 --- a/arch/um/drivers/port_kern.c +++ b/arch/um/drivers/port_kern.c @@ -6,6 +6,7 @@ #include "linux/completion.h" #include "linux/interrupt.h" #include "linux/list.h" +#include "linux/mutex.h" #include "asm/atomic.h" #include "init.h" #include "irq_kern.h" @@ -120,7 +121,7 @@ static int port_accept(struct port_list *port) return 0; } -static DECLARE_MUTEX(ports_sem); +static DEFINE_MUTEX(ports_mutex); static LIST_HEAD(ports); static void port_work_proc(struct work_struct *unused) @@ -161,7 +162,7 @@ void *port_data(int port_num) struct port_dev *dev = NULL; int fd; - down(&ports_sem); + mutex_lock(&ports_mutex); list_for_each(ele, &ports) { port = list_entry(ele, struct port_list, list); if (port->port == port_num) @@ -216,7 +217,7 @@ void *port_data(int port_num) out_free: kfree(port); out: - up(&ports_sem); + mutex_unlock(&ports_mutex); return dev; } - To unsubscribe from this list: send the line "unsubscribe git-commits-head" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html