Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180383
b: refs/heads/master
c: 8781ff9
h: refs/heads/master
i:
  180381: 6466381
  180379: 7bedfb9
  180375: 87345c3
  180367: 086a9c8
  180351: 46a6335
v: v3
  • Loading branch information
Eric Van Hensbergen committed Feb 9, 2010
1 parent 057b42e commit 748641e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bf2d29c64dd777e9a40bc4533e721944a590250f
refs/heads/master: 8781ff9495578dbb74065fae55305110d9f81cb9
31 changes: 19 additions & 12 deletions trunk/net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,18 +676,12 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
clnt->trans = NULL;
spin_lock_init(&clnt->lock);
INIT_LIST_HEAD(&clnt->fidlist);
clnt->fidpool = p9_idpool_create();
if (IS_ERR(clnt->fidpool)) {
err = PTR_ERR(clnt->fidpool);
clnt->fidpool = NULL;
goto error;
}

p9_tag_init(clnt);

err = parse_opts(options, clnt);
if (err < 0)
goto error;
goto free_client;

if (!clnt->trans_mod)
clnt->trans_mod = v9fs_get_default_trans();
Expand All @@ -696,27 +690,40 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
err = -EPROTONOSUPPORT;
P9_DPRINTK(P9_DEBUG_ERROR,
"No transport defined or default transport\n");
goto error;
goto free_client;
}

clnt->fidpool = p9_idpool_create();
if (IS_ERR(clnt->fidpool)) {
err = PTR_ERR(clnt->fidpool);
clnt->fidpool = NULL;
goto put_trans;
}

P9_DPRINTK(P9_DEBUG_MUX, "clnt %p trans %p msize %d dotu %d\n",
clnt, clnt->trans_mod, clnt->msize, clnt->dotu);

err = clnt->trans_mod->create(clnt, dev_name, options);
if (err)
goto error;
goto destroy_fidpool;

if ((clnt->msize+P9_IOHDRSZ) > clnt->trans_mod->maxsize)
clnt->msize = clnt->trans_mod->maxsize-P9_IOHDRSZ;

err = p9_client_version(clnt);
if (err)
goto error;
goto close_trans;

return clnt;

error:
p9_client_destroy(clnt);
close_trans:
clnt->trans_mod->close(clnt);
destroy_fidpool:
p9_idpool_destroy(clnt->fidpool);
put_trans:
v9fs_put_trans(clnt->trans_mod);
free_client:
kfree(clnt);
return ERR_PTR(err);
}
EXPORT_SYMBOL(p9_client_create);
Expand Down

0 comments on commit 748641e

Please sign in to comment.