ia64/xen-unstable

changeset 13973:b3c41b9f01a6

linux: proper mutex use in balloon driver
Mutexes are supposed to not use the old semaphore technique anymore.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
author kfraser@localhost.localdomain
date Thu Feb 15 13:38:59 2007 +0000 (2007-02-15)
parents 89d315c7dcea
children 449fb89590e7
files linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Thu Feb 15 13:36:58 2007 +0000
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/balloon/balloon.c	Thu Feb 15 13:38:59 2007 +0000
     1.3 @@ -60,7 +60,7 @@
     1.4  static struct proc_dir_entry *balloon_pde;
     1.5  #endif
     1.6  
     1.7 -static DECLARE_MUTEX(balloon_mutex);
     1.8 +static DEFINE_MUTEX(balloon_mutex);
     1.9  
    1.10  /*
    1.11   * Protects atomic reservation decrease/increase against concurrent increases.
    1.12 @@ -321,7 +321,7 @@ static void balloon_process(void *unused
    1.13  	int need_sleep = 0;
    1.14  	long credit;
    1.15  
    1.16 -	down(&balloon_mutex);
    1.17 +	mutex_lock(&balloon_mutex);
    1.18  
    1.19  	do {
    1.20  		credit = current_target() - bs.current_pages;
    1.21 @@ -340,7 +340,7 @@ static void balloon_process(void *unused
    1.22  	if (current_target() != bs.current_pages)
    1.23  		mod_timer(&balloon_timer, jiffies + HZ);
    1.24  
    1.25 -	up(&balloon_mutex);
    1.26 +	mutex_unlock(&balloon_mutex);
    1.27  }
    1.28  
    1.29  /* Resets the Xen limit, sets new target, and kicks off processing. */