diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
commit | 1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch) | |
tree | f5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /net/sunrpc/sched.c | |
parent | ac58c9059da8886b5e8cde012a80266b18ca146e (diff) | |
parent | 674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff) |
Merge branch 'linus'
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 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 | */ |
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 | struct workqueue_struct *rpciod_workqueue; | 68 | struct 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; |
1080 | out: | 1081 | out: |
1081 | up(&rpciod_sema); | 1082 | mutex_unlock(&rpciod_mutex); |
1082 | return error; | 1083 | return error; |
1083 | } | 1084 | } |
1084 | 1085 | ||
1085 | void | 1086 | void |
1086 | rpciod_down(void) | 1087 | rpciod_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 |