提交 0245583a 编写于 作者: D Daniel Walker 提交者: Tony Luck

[IA64] sn_hwperf semaphore to mutex

Really simple mutex style semaphore user. The new API is struct mutex which is
what I've converted it to with this change.
Signed-off-by: NDaniel Walker <dwalker@mvista.com>
Signed-off-by: NTony Luck <tony.luck@intel.com>
上级 acffc84a
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/nodemask.h> #include <linux/nodemask.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/mutex.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/topology.h> #include <asm/topology.h>
...@@ -50,7 +51,7 @@ static void *sn_hwperf_salheap = NULL; ...@@ -50,7 +51,7 @@ static void *sn_hwperf_salheap = NULL;
static int sn_hwperf_obj_cnt = 0; static int sn_hwperf_obj_cnt = 0;
static nasid_t sn_hwperf_master_nasid = INVALID_NASID; static nasid_t sn_hwperf_master_nasid = INVALID_NASID;
static int sn_hwperf_init(void); static int sn_hwperf_init(void);
static DECLARE_MUTEX(sn_hwperf_init_mutex); static DEFINE_MUTEX(sn_hwperf_init_mutex);
#define cnode_possible(n) ((n) < num_cnodes) #define cnode_possible(n) ((n) < num_cnodes)
...@@ -884,10 +885,10 @@ static int sn_hwperf_init(void) ...@@ -884,10 +885,10 @@ static int sn_hwperf_init(void)
int e = 0; int e = 0;
/* single threaded, once-only initialization */ /* single threaded, once-only initialization */
down(&sn_hwperf_init_mutex); mutex_lock(&sn_hwperf_init_mutex);
if (sn_hwperf_salheap) { if (sn_hwperf_salheap) {
up(&sn_hwperf_init_mutex); mutex_unlock(&sn_hwperf_init_mutex);
return e; return e;
} }
...@@ -936,7 +937,7 @@ static int sn_hwperf_init(void) ...@@ -936,7 +937,7 @@ static int sn_hwperf_init(void)
sn_hwperf_salheap = NULL; sn_hwperf_salheap = NULL;
sn_hwperf_obj_cnt = 0; sn_hwperf_obj_cnt = 0;
} }
up(&sn_hwperf_init_mutex); mutex_unlock(&sn_hwperf_init_mutex);
return e; return e;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册