All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/8] 2.6.17: proper mutex use
@ 2007-02-14 15:57 Jan Beulich
  0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2007-02-14 15:57 UTC (permalink / raw)
  To: xen-devel

Mutexes are supposed to not use the old semaphore technique anymore.

Signed-off-by: Jan Beulich <jbeulich@novell.com>

Index: head-2007-02-08/drivers/xen/balloon/balloon.c
===================================================================
--- head-2007-02-08.orig/drivers/xen/balloon/balloon.c	2007-02-08 17:07:13.000000000 +0100
+++ head-2007-02-08/drivers/xen/balloon/balloon.c	2007-02-08 17:09:47.000000000 +0100
@@ -60,7 +60,7 @@
 static struct proc_dir_entry *balloon_pde;
 #endif
 
-static DECLARE_MUTEX(balloon_mutex);
+static DEFINE_MUTEX(balloon_mutex);
 
 /*
  * Protects atomic reservation decrease/increase against concurrent increases.
@@ -321,7 +321,7 @@ static void balloon_process(void *unused
 	int need_sleep = 0;
 	long credit;
 
-	down(&balloon_mutex);
+	mutex_lock(&balloon_mutex);
 
 	do {
 		credit = current_target() - bs.current_pages;
@@ -340,7 +340,7 @@ static void balloon_process(void *unused
 	if (current_target() != bs.current_pages)
 		mod_timer(&balloon_timer, jiffies + HZ);
 
-	up(&balloon_mutex);
+	mutex_unlock(&balloon_mutex);
 }
 
 /* Resets the Xen limit, sets new target, and kicks off processing. */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-02-14 15:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-14 15:57 [PATCH 1/8] 2.6.17: proper mutex use Jan Beulich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.