[PATCH] v9fs: add extension field to Tcreate
[safe/jmp/linux-2.6] / fs / 9p / mux.c
index 8e8356c..d16f4f4 100644 (file)
@@ -70,7 +70,7 @@ struct v9fs_mux_data {
        int msize;
        unsigned char *extended;
        struct v9fs_transport *trans;
-       struct v9fs_idpool tidpool;
+       struct v9fs_idpool tagpool;
        int err;
        wait_queue_head_t equeue;
        struct list_head req_list;
@@ -143,7 +143,7 @@ void v9fs_mux_global_exit(void)
  *
  * The current implementation returns sqrt of the number of mounts.
  */
-inline int v9fs_mux_calc_poll_procs(int muxnum)
+static int v9fs_mux_calc_poll_procs(int muxnum)
 {
        int n;
 
@@ -280,8 +280,8 @@ struct v9fs_mux_data *v9fs_mux_init(struct v9fs_transport *trans, int msize,
        m->msize = msize;
        m->extended = extended;
        m->trans = trans;
-       idr_init(&m->tidpool.pool);
-       init_MUTEX(&m->tidpool.lock);
+       idr_init(&m->tagpool.pool);
+       init_MUTEX(&m->tagpool.lock);
        m->err = 0;
        init_waitqueue_head(&m->equeue);
        INIT_LIST_HEAD(&m->req_list);
@@ -384,7 +384,7 @@ v9fs_pollwait(struct file *filp, wait_queue_head_t * wait_address,
 /**
  * v9fs_poll_mux - polls a mux and schedules read or write works if necessary
  */
-static inline void v9fs_poll_mux(struct v9fs_mux_data *m)
+static void v9fs_poll_mux(struct v9fs_mux_data *m)
 {
        int n;
 
@@ -635,6 +635,14 @@ static void v9fs_read_work(void *a)
                        goto error;
                }
 
+               if ((v9fs_debug_level&DEBUG_FCALL) == DEBUG_FCALL) {
+                       char buf[150];
+
+                       v9fs_printfcall(buf, sizeof(buf), m->rcall,
+                               *m->extended);
+                       printk(KERN_NOTICE ">>> %p %s\n", m, buf);
+               }
+
                rcall = m->rcall;
                rbuf = m->rbuf;
                if (m->rpos > n) {
@@ -740,6 +748,13 @@ static struct v9fs_req *v9fs_send_request(struct v9fs_mux_data *m,
 
        v9fs_set_tag(tc, n);
 
+       if ((v9fs_debug_level&DEBUG_FCALL) == DEBUG_FCALL) {
+               char buf[150];
+
+               v9fs_printfcall(buf, sizeof(buf), tc, *m->extended);
+               printk(KERN_NOTICE "<<< %p %s\n", m, buf);
+       }
+
        req->tag = n;
        req->tcall = tc;
        req->rcall = NULL;
@@ -762,9 +777,8 @@ static struct v9fs_req *v9fs_send_request(struct v9fs_mux_data *m,
        return req;
 }
 
-static inline void
-v9fs_mux_flush_cb(void *a, struct v9fs_fcall *tc, struct v9fs_fcall *rc,
-                 int err)
+static void v9fs_mux_flush_cb(void *a, struct v9fs_fcall *tc,
+                             struct v9fs_fcall *rc, int err)
 {
        v9fs_mux_req_callback cb;
        int tag;
@@ -902,6 +916,7 @@ v9fs_mux_rpc(struct v9fs_mux_data *m, struct v9fs_fcall *tc,
        return err;
 }
 
+#if 0
 /**
  * v9fs_mux_rpcnb - sends 9P request without waiting for response.
  * @m: mux data
@@ -925,6 +940,7 @@ int v9fs_mux_rpcnb(struct v9fs_mux_data *m, struct v9fs_fcall *tc,
        dprintk(DEBUG_MUX, "mux %p tc %p tag %d\n", m, tc, req->tag);
        return 0;
 }
+#endif  /*  0  */
 
 /**
  * v9fs_mux_cancel - cancel all pending requests with error
@@ -964,7 +980,7 @@ static u16 v9fs_mux_get_tag(struct v9fs_mux_data *m)
 {
        int tag;
 
-       tag = v9fs_get_idpool(&m->tidpool);
+       tag = v9fs_get_idpool(&m->tagpool);
        if (tag < 0)
                return V9FS_NOTAG;
        else
@@ -973,6 +989,6 @@ static u16 v9fs_mux_get_tag(struct v9fs_mux_data *m)
 
 static void v9fs_mux_put_tag(struct v9fs_mux_data *m, u16 tag)
 {
-       if (tag != V9FS_NOTAG && v9fs_check_idpool(tag, &m->tidpool))
-               v9fs_put_idpool(tag, &m->tidpool);
+       if (tag != V9FS_NOTAG && v9fs_check_idpool(tag, &m->tagpool))
+               v9fs_put_idpool(tag, &m->tagpool);
 }