aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric Van Hensbergen <ericvh@ericvh-desktop.austin.ibm.com>2008-10-13 19:45:24 -0400
committerEric Van Hensbergen <ericvh@gmail.com>2008-10-17 12:04:41 -0400
commitbead27f0a87f4055f6a0fd69ded9eacced485618 (patch)
tree22e4631f9b07cdcb5d520ba30a5843e859d00c47 /net
parent8b81ef589ad1483dd977ef47fe00d4ce4d91a0ab (diff)
9p: remove duplicate client state
Now that we are passing client state into the transport modules, remove duplicate state which is present in transport private structures. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net')
-rw-r--r--net/9p/trans_fd.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index d09389f08382..bc5b6965981b 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -145,8 +145,6 @@ struct p9_poll_wait {
145 * struct p9_conn - fd mux connection state information 145 * struct p9_conn - fd mux connection state information
146 * @lock: protects mux_list (?) 146 * @lock: protects mux_list (?)
147 * @mux_list: list link for mux to manage multiple connections (?) 147 * @mux_list: list link for mux to manage multiple connections (?)
148 * @msize: maximum size for connection (dup)
149 * @extended: 9p2000.u flag (dup)
150 * @client: reference to client instance for this connection 148 * @client: reference to client instance for this connection
151 * @tagpool: id accounting for transactions 149 * @tagpool: id accounting for transactions
152 * @err: error state 150 * @err: error state
@@ -170,8 +168,6 @@ struct p9_poll_wait {
170struct p9_conn { 168struct p9_conn {
171 spinlock_t lock; /* protect lock structure */ 169 spinlock_t lock; /* protect lock structure */
172 struct list_head mux_list; 170 struct list_head mux_list;
173 int msize;
174 unsigned char extended;
175 struct p9_client *client; 171 struct p9_client *client;
176 struct p9_idpool *tagpool; 172 struct p9_idpool *tagpool;
177 int err; 173 int err;
@@ -289,8 +285,6 @@ static struct p9_conn *p9_conn_create(struct p9_client *client)
289 285
290 spin_lock_init(&m->lock); 286 spin_lock_init(&m->lock);
291 INIT_LIST_HEAD(&m->mux_list); 287 INIT_LIST_HEAD(&m->mux_list);
292 m->msize = client->msize;
293 m->extended = client->dotu;
294 m->client = client; 288 m->client = client;
295 m->tagpool = p9_idpool_create(); 289 m->tagpool = p9_idpool_create();
296 if (IS_ERR(m->tagpool)) { 290 if (IS_ERR(m->tagpool)) {
@@ -584,7 +578,7 @@ static void process_request(struct p9_conn *m, struct p9_req *req)
584 P9_DPRINTK(P9_DEBUG_MUX, "Rerror %.*s\n", ename->len, 578 P9_DPRINTK(P9_DEBUG_MUX, "Rerror %.*s\n", ename->len,
585 ename->str); 579 ename->str);
586 580
587 if (m->extended) 581 if (m->client->dotu)
588 req->err = -ecode; 582 req->err = -ecode;
589 583
590 if (!req->err) { 584 if (!req->err) {
@@ -629,7 +623,8 @@ static void p9_read_work(struct work_struct *work)
629 623
630 if (!m->rcall) { 624 if (!m->rcall) {
631 m->rcall = 625 m->rcall =
632 kmalloc(sizeof(struct p9_fcall) + m->msize, GFP_KERNEL); 626 kmalloc(sizeof(struct p9_fcall) + m->client->msize,
627 GFP_KERNEL);
633 if (!m->rcall) { 628 if (!m->rcall) {
634 err = -ENOMEM; 629 err = -ENOMEM;
635 goto error; 630 goto error;
@@ -640,7 +635,8 @@ static void p9_read_work(struct work_struct *work)
640 } 635 }
641 636
642 clear_bit(Rpending, &m->wsched); 637 clear_bit(Rpending, &m->wsched);
643 err = p9_fd_read(m->client, m->rbuf + m->rpos, m->msize - m->rpos); 638 err = p9_fd_read(m->client, m->rbuf + m->rpos,
639 m->client->msize - m->rpos);
644 P9_DPRINTK(P9_DEBUG_MUX, "mux %p got %d bytes\n", m, err); 640 P9_DPRINTK(P9_DEBUG_MUX, "mux %p got %d bytes\n", m, err);
645 if (err == -EAGAIN) { 641 if (err == -EAGAIN) {
646 clear_bit(Rworksched, &m->wsched); 642 clear_bit(Rworksched, &m->wsched);
@@ -653,7 +649,7 @@ static void p9_read_work(struct work_struct *work)
653 m->rpos += err; 649 m->rpos += err;
654 while (m->rpos > 4) { 650 while (m->rpos > 4) {
655 n = le32_to_cpu(*(__le32 *) m->rbuf); 651 n = le32_to_cpu(*(__le32 *) m->rbuf);
656 if (n >= m->msize) { 652 if (n >= m->client->msize) {
657 P9_DPRINTK(P9_DEBUG_ERROR, 653 P9_DPRINTK(P9_DEBUG_ERROR,
658 "requested packet size too big: %d\n", n); 654 "requested packet size too big: %d\n", n);
659 err = -EIO; 655 err = -EIO;
@@ -664,7 +660,7 @@ static void p9_read_work(struct work_struct *work)
664 break; 660 break;
665 661
666 err = 662 err =
667 p9_deserialize_fcall(m->rbuf, n, m->rcall, m->extended); 663 p9_deserialize_fcall(m->rbuf, n, m->rcall, m->client->dotu);
668 if (err < 0) 664 if (err < 0)
669 goto error; 665 goto error;
670 666
@@ -673,7 +669,7 @@ static void p9_read_work(struct work_struct *work)
673 char buf[150]; 669 char buf[150];
674 670
675 p9_printfcall(buf, sizeof(buf), m->rcall, 671 p9_printfcall(buf, sizeof(buf), m->rcall,
676 m->extended); 672 m->client->dotu);
677 printk(KERN_NOTICE ">>> %p %s\n", m, buf); 673 printk(KERN_NOTICE ">>> %p %s\n", m, buf);
678 } 674 }
679#endif 675#endif
@@ -681,8 +677,8 @@ static void p9_read_work(struct work_struct *work)
681 rcall = m->rcall; 677 rcall = m->rcall;
682 rbuf = m->rbuf; 678 rbuf = m->rbuf;
683 if (m->rpos > n) { 679 if (m->rpos > n) {
684 m->rcall = kmalloc(sizeof(struct p9_fcall) + m->msize, 680 m->rcall = kmalloc(sizeof(struct p9_fcall) +
685 GFP_KERNEL); 681 m->client->msize, GFP_KERNEL);
686 if (!m->rcall) { 682 if (!m->rcall) {
687 err = -ENOMEM; 683 err = -ENOMEM;
688 goto error; 684 goto error;
@@ -798,7 +794,7 @@ static struct p9_req *p9_send_request(struct p9_conn *m,
798 if ((p9_debug_level&P9_DEBUG_FCALL) == P9_DEBUG_FCALL) { 794 if ((p9_debug_level&P9_DEBUG_FCALL) == P9_DEBUG_FCALL) {
799 char buf[150]; 795 char buf[150];
800 796
801 p9_printfcall(buf, sizeof(buf), tc, m->extended); 797 p9_printfcall(buf, sizeof(buf), tc, m->client->dotu);
802 printk(KERN_NOTICE "<<< %p %s\n", m, buf); 798 printk(KERN_NOTICE "<<< %p %s\n", m, buf);
803 } 799 }
804#endif 800#endif