diff options
Diffstat (limited to 'net/sunrpc/sched.c')
-rw-r--r-- | net/sunrpc/sched.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index e838d042f7f5..dff07795bd16 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 | */ |
65 | static DECLARE_MUTEX(rpciod_sema); | 66 | static DEFINE_MUTEX(rpciod_mutex); |
66 | static unsigned int rpciod_users; | 67 | static unsigned int rpciod_users; |
67 | static struct workqueue_struct *rpciod_workqueue; | 68 | static struct workqueue_struct *rpciod_workqueue; |
68 | 69 | ||
@@ -1047,7 +1048,7 @@ rpciod_up(void) | |||
1047 | struct workqueue_struct *wq; | 1048 | struct workqueue_struct *wq; |
1048 | int error = 0; | 1049 | int error = 0; |
1049 | 1050 | ||
1050 | down(&rpciod_sema); | 1051 | mutex_lock(&rpciod_mutex); |
1051 | dprintk("rpciod_up: users %d\n", rpciod_users); | 1052 | dprintk("rpciod_up: users %d\n", rpciod_users); |
1052 | rpciod_users++; | 1053 | rpciod_users++; |
1053 | if (rpciod_workqueue) | 1054 | if (rpciod_workqueue) |
@@ -1070,14 +1071,14 @@ rpciod_up(void) | |||
1070 | rpciod_workqueue = wq; | 1071 | rpciod_workqueue = wq; |
1071 | error = 0; | 1072 | error = 0; |
1072 | out: | 1073 | out: |
1073 | up(&rpciod_sema); | 1074 | mutex_unlock(&rpciod_mutex); |
1074 | return error; | 1075 | return error; |
1075 | } | 1076 | } |
1076 | 1077 | ||
1077 | void | 1078 | void |
1078 | rpciod_down(void) | 1079 | rpciod_down(void) |
1079 | { | 1080 | { |
1080 | down(&rpciod_sema); | 1081 | mutex_lock(&rpciod_mutex); |
1081 | dprintk("rpciod_down sema %d\n", rpciod_users); | 1082 | dprintk("rpciod_down sema %d\n", rpciod_users); |
1082 | if (rpciod_users) { | 1083 | if (rpciod_users) { |
1083 | if (--rpciod_users) | 1084 | if (--rpciod_users) |
@@ -1094,7 +1095,7 @@ rpciod_down(void) | |||
1094 | destroy_workqueue(rpciod_workqueue); | 1095 | destroy_workqueue(rpciod_workqueue); |
1095 | rpciod_workqueue = NULL; | 1096 | rpciod_workqueue = NULL; |
1096 | out: | 1097 | out: |
1097 | up(&rpciod_sema); | 1098 | mutex_unlock(&rpciod_mutex); |
1098 | } | 1099 | } |
1099 | 1100 | ||
1100 | #ifdef RPC_DEBUG | 1101 | #ifdef RPC_DEBUG |