summaryrefslogtreecommitdiff
path: root/net/9p/client.c
diff options
context:
space:
mode:
authorEric Van Hensbergen <ericvh@ericvh-desktop.austin.ibm.com>2008-10-13 18:45:25 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2008-10-17 11:04:41 -0500
commit8b81ef589ad1483dd977ef47fe00d4ce4d91a0ab (patch)
tree380a19ca0f55fefc60c4a45771f5273c80539c07 /net/9p/client.c
parent992b3f1dbeec401e19a80bdb8c81e5df5381f4c5 (diff)
9p: consolidate transport structure
Right now there is a transport module structure which provides per-transport type functions and data and a transport structure which contains per-instance public data as well as function pointers to instance specific functions. This patch moves public transport visible instance data to the client structure (which in some cases had duplicate data) and consolidates the functions into the transport module structure. Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net/9p/client.c')
-rw-r--r--net/9p/client.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/net/9p/client.c b/net/9p/client.c
index e053e06028a5..f1a52a7ed724 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -33,8 +33,8 @@
#include <linux/uaccess.h>
#include <net/9p/9p.h>
#include <linux/parser.h>
-#include <net/9p/transport.h>
#include <net/9p/client.h>
+#include <net/9p/transport.h>
static struct p9_fid *p9_fid_create(struct p9_client *clnt);
static void p9_fid_destroy(struct p9_fid *fid);
@@ -136,7 +136,7 @@ int
p9_client_rpc(struct p9_client *c, struct p9_fcall *tc,
struct p9_fcall **rc)
{
- return c->trans->rpc(c->trans, tc, rc);
+ return c->trans_mod->rpc(c, tc, rc);
}
struct p9_client *p9_client_create(const char *dev_name, char *options)
@@ -179,13 +179,9 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
clnt, clnt->trans_mod, clnt->msize, clnt->dotu);
- clnt->trans = clnt->trans_mod->create(dev_name, options, clnt->msize,
- clnt->dotu);
- if (IS_ERR(clnt->trans)) {
- err = PTR_ERR(clnt->trans);
- clnt->trans = NULL;
+ err = clnt->trans_mod->create(clnt, dev_name, options);
+ if (err)
goto error;
- }
if ((clnt->msize+P9_IOHDRSZ) > clnt->trans_mod->maxsize)
clnt->msize = clnt->trans_mod->maxsize-P9_IOHDRSZ;
@@ -233,11 +229,8 @@ void p9_client_destroy(struct p9_client *clnt)
P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt);
- if (clnt->trans) {
- clnt->trans->close(clnt->trans);
- kfree(clnt->trans);
- clnt->trans = NULL;
- }
+ if (clnt->trans_mod)
+ clnt->trans_mod->close(clnt);
v9fs_put_trans(clnt->trans_mod);
@@ -254,7 +247,7 @@ EXPORT_SYMBOL(p9_client_destroy);
void p9_client_disconnect(struct p9_client *clnt)
{
P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt);
- clnt->trans->status = Disconnected;
+ clnt->status = Disconnected;
}
EXPORT_SYMBOL(p9_client_disconnect);