diff options
Diffstat (limited to 'net/9p/client.c')
-rw-r--r-- | net/9p/client.c | 21 |
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 @@ | |||
33 | #include <linux/uaccess.h> | 33 | #include <linux/uaccess.h> |
34 | #include <net/9p/9p.h> | 34 | #include <net/9p/9p.h> |
35 | #include <linux/parser.h> | 35 | #include <linux/parser.h> |
36 | #include <net/9p/transport.h> | ||
37 | #include <net/9p/client.h> | 36 | #include <net/9p/client.h> |
37 | #include <net/9p/transport.h> | ||
38 | 38 | ||
39 | static struct p9_fid *p9_fid_create(struct p9_client *clnt); | 39 | static struct p9_fid *p9_fid_create(struct p9_client *clnt); |
40 | static void p9_fid_destroy(struct p9_fid *fid); | 40 | static void p9_fid_destroy(struct p9_fid *fid); |
@@ -136,7 +136,7 @@ int | |||
136 | p9_client_rpc(struct p9_client *c, struct p9_fcall *tc, | 136 | p9_client_rpc(struct p9_client *c, struct p9_fcall *tc, |
137 | struct p9_fcall **rc) | 137 | struct p9_fcall **rc) |
138 | { | 138 | { |
139 | return c->trans->rpc(c->trans, tc, rc); | 139 | return c->trans_mod->rpc(c, tc, rc); |
140 | } | 140 | } |
141 | 141 | ||
142 | struct p9_client *p9_client_create(const char *dev_name, char *options) | 142 | 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) | |||
179 | clnt, clnt->trans_mod, clnt->msize, clnt->dotu); | 179 | clnt, clnt->trans_mod, clnt->msize, clnt->dotu); |
180 | 180 | ||
181 | 181 | ||
182 | clnt->trans = clnt->trans_mod->create(dev_name, options, clnt->msize, | 182 | err = clnt->trans_mod->create(clnt, dev_name, options); |
183 | clnt->dotu); | 183 | if (err) |
184 | if (IS_ERR(clnt->trans)) { | ||
185 | err = PTR_ERR(clnt->trans); | ||
186 | clnt->trans = NULL; | ||
187 | goto error; | 184 | goto error; |
188 | } | ||
189 | 185 | ||
190 | if ((clnt->msize+P9_IOHDRSZ) > clnt->trans_mod->maxsize) | 186 | if ((clnt->msize+P9_IOHDRSZ) > clnt->trans_mod->maxsize) |
191 | clnt->msize = clnt->trans_mod->maxsize-P9_IOHDRSZ; | 187 | clnt->msize = clnt->trans_mod->maxsize-P9_IOHDRSZ; |
@@ -233,11 +229,8 @@ void p9_client_destroy(struct p9_client *clnt) | |||
233 | 229 | ||
234 | P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt); | 230 | P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt); |
235 | 231 | ||
236 | if (clnt->trans) { | 232 | if (clnt->trans_mod) |
237 | clnt->trans->close(clnt->trans); | 233 | clnt->trans_mod->close(clnt); |
238 | kfree(clnt->trans); | ||
239 | clnt->trans = NULL; | ||
240 | } | ||
241 | 234 | ||
242 | v9fs_put_trans(clnt->trans_mod); | 235 | v9fs_put_trans(clnt->trans_mod); |
243 | 236 | ||
@@ -254,7 +247,7 @@ EXPORT_SYMBOL(p9_client_destroy); | |||
254 | void p9_client_disconnect(struct p9_client *clnt) | 247 | void p9_client_disconnect(struct p9_client *clnt) |
255 | { | 248 | { |
256 | P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt); | 249 | P9_DPRINTK(P9_DEBUG_9P, "clnt %p\n", clnt); |
257 | clnt->trans->status = Disconnected; | 250 | clnt->status = Disconnected; |
258 | } | 251 | } |
259 | EXPORT_SYMBOL(p9_client_disconnect); | 252 | EXPORT_SYMBOL(p9_client_disconnect); |
260 | 253 | ||