aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/mux.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-23 23:44:19 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-23 23:44:19 -0500
commit1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch)
treef5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /fs/9p/mux.c
parentac58c9059da8886b5e8cde012a80266b18ca146e (diff)
parent674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff)
Merge branch 'linus'
Diffstat (limited to 'fs/9p/mux.c')
-rw-r--r--fs/9p/mux.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs/9p/mux.c b/fs/9p/mux.c
index ea1134eb47c8..8e8356c1c229 100644
--- a/fs/9p/mux.c
+++ b/fs/9p/mux.c
@@ -31,6 +31,7 @@
31#include <linux/poll.h> 31#include <linux/poll.h>
32#include <linux/kthread.h> 32#include <linux/kthread.h>
33#include <linux/idr.h> 33#include <linux/idr.h>
34#include <linux/mutex.h>
34 35
35#include "debug.h" 36#include "debug.h"
36#include "v9fs.h" 37#include "v9fs.h"
@@ -110,7 +111,7 @@ static void v9fs_pollwait(struct file *filp, wait_queue_head_t * wait_address,
110static u16 v9fs_mux_get_tag(struct v9fs_mux_data *); 111static u16 v9fs_mux_get_tag(struct v9fs_mux_data *);
111static void v9fs_mux_put_tag(struct v9fs_mux_data *, u16); 112static void v9fs_mux_put_tag(struct v9fs_mux_data *, u16);
112 113
113static DECLARE_MUTEX(v9fs_mux_task_lock); 114static DEFINE_MUTEX(v9fs_mux_task_lock);
114static struct workqueue_struct *v9fs_mux_wq; 115static struct workqueue_struct *v9fs_mux_wq;
115 116
116static int v9fs_mux_num; 117static int v9fs_mux_num;
@@ -166,7 +167,7 @@ static int v9fs_mux_poll_start(struct v9fs_mux_data *m)
166 167
167 dprintk(DEBUG_MUX, "mux %p muxnum %d procnum %d\n", m, v9fs_mux_num, 168 dprintk(DEBUG_MUX, "mux %p muxnum %d procnum %d\n", m, v9fs_mux_num,
168 v9fs_mux_poll_task_num); 169 v9fs_mux_poll_task_num);
169 up(&v9fs_mux_task_lock); 170 mutex_lock(&v9fs_mux_task_lock);
170 171
171 n = v9fs_mux_calc_poll_procs(v9fs_mux_num + 1); 172 n = v9fs_mux_calc_poll_procs(v9fs_mux_num + 1);
172 if (n > v9fs_mux_poll_task_num) { 173 if (n > v9fs_mux_poll_task_num) {
@@ -225,7 +226,7 @@ static int v9fs_mux_poll_start(struct v9fs_mux_data *m)
225 } 226 }
226 227
227 v9fs_mux_num++; 228 v9fs_mux_num++;
228 down(&v9fs_mux_task_lock); 229 mutex_unlock(&v9fs_mux_task_lock);
229 230
230 return 0; 231 return 0;
231} 232}
@@ -235,7 +236,7 @@ static void v9fs_mux_poll_stop(struct v9fs_mux_data *m)
235 int i; 236 int i;
236 struct v9fs_mux_poll_task *vpt; 237 struct v9fs_mux_poll_task *vpt;
237 238
238 up(&v9fs_mux_task_lock); 239 mutex_lock(&v9fs_mux_task_lock);
239 vpt = m->poll_task; 240 vpt = m->poll_task;
240 list_del(&m->mux_list); 241 list_del(&m->mux_list);
241 for(i = 0; i < ARRAY_SIZE(m->poll_waddr); i++) { 242 for(i = 0; i < ARRAY_SIZE(m->poll_waddr); i++) {
@@ -252,7 +253,7 @@ static void v9fs_mux_poll_stop(struct v9fs_mux_data *m)
252 v9fs_mux_poll_task_num--; 253 v9fs_mux_poll_task_num--;
253 } 254 }
254 v9fs_mux_num--; 255 v9fs_mux_num--;
255 down(&v9fs_mux_task_lock); 256 mutex_unlock(&v9fs_mux_task_lock);
256} 257}
257 258
258/** 259/**