aboutsummaryrefslogtreecommitdiffstats
path: root/net/sunrpc/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sunrpc/sched.c')
-rw-r--r--net/sunrpc/sched.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 3fc13bea302d..b9969b91a9f7 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -18,6 +18,7 @@
18#include <linux/smp.h> 18#include <linux/smp.h>
19#include <linux/smp_lock.h> 19#include <linux/smp_lock.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/mutex.h>
21 22
22#include <linux/sunrpc/clnt.h> 23#include <linux/sunrpc/clnt.h>
23#include <linux/sunrpc/xprt.h> 24#include <linux/sunrpc/xprt.h>
@@ -62,7 +63,7 @@ static LIST_HEAD(all_tasks);
62/* 63/*
63 * rpciod-related stuff 64 * rpciod-related stuff
64 */ 65 */
65static DECLARE_MUTEX(rpciod_sema); 66static DEFINE_MUTEX(rpciod_mutex);
66static unsigned int rpciod_users; 67static unsigned int rpciod_users;
67struct workqueue_struct *rpciod_workqueue; 68struct workqueue_struct *rpciod_workqueue;
68 69
@@ -1055,7 +1056,7 @@ rpciod_up(void)
1055 struct workqueue_struct *wq; 1056 struct workqueue_struct *wq;
1056 int error = 0; 1057 int error = 0;
1057 1058
1058 down(&rpciod_sema); 1059 mutex_lock(&rpciod_mutex);
1059 dprintk("rpciod_up: users %d\n", rpciod_users); 1060 dprintk("rpciod_up: users %d\n", rpciod_users);
1060 rpciod_users++; 1061 rpciod_users++;
1061 if (rpciod_workqueue) 1062 if (rpciod_workqueue)
@@ -1078,14 +1079,14 @@ rpciod_up(void)
1078 rpciod_workqueue = wq; 1079 rpciod_workqueue = wq;
1079 error = 0; 1080 error = 0;
1080out: 1081out:
1081 up(&rpciod_sema); 1082 mutex_unlock(&rpciod_mutex);
1082 return error; 1083 return error;
1083} 1084}
1084 1085
1085void 1086void
1086rpciod_down(void) 1087rpciod_down(void)
1087{ 1088{
1088 down(&rpciod_sema); 1089 mutex_lock(&rpciod_mutex);
1089 dprintk("rpciod_down sema %d\n", rpciod_users); 1090 dprintk("rpciod_down sema %d\n", rpciod_users);
1090 if (rpciod_users) { 1091 if (rpciod_users) {
1091 if (--rpciod_users) 1092 if (--rpciod_users)
@@ -1102,7 +1103,7 @@ rpciod_down(void)
1102 destroy_workqueue(rpciod_workqueue); 1103 destroy_workqueue(rpciod_workqueue);
1103 rpciod_workqueue = NULL; 1104 rpciod_workqueue = NULL;
1104 out: 1105 out:
1105 up(&rpciod_sema); 1106 mutex_unlock(&rpciod_mutex);
1106} 1107}
1107 1108
1108#ifdef RPC_DEBUG 1109#ifdef RPC_DEBUG