Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251295
b: refs/heads/master
c: fe1cbab
h: refs/heads/master
i:
  251293: c2a8b12
  251291: ab3d4ed
  251287: 6384735
  251279: ac3f2d2
  251263: b48118c
v: v3
  • Loading branch information
Aneesh Kumar K.V authored and Eric Van Hensbergen committed May 25, 2011
1 parent 98f56c8 commit 98a85a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 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: 398c4f0efb5c2f07fe2f5cd67031b15fd3e920c9
refs/heads/master: fe1cbabaea5e99a93bafe12fbf1b3b9cc71b610a
20 changes: 12 additions & 8 deletions trunk/net/9p/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,13 @@ static int p9_tag_init(struct p9_client *c)
c->tagpool = p9_idpool_create();
if (IS_ERR(c->tagpool)) {
err = PTR_ERR(c->tagpool);
c->tagpool = NULL;
goto error;
}

p9_idpool_get(c->tagpool); /* reserve tag 0 */

err = p9_idpool_get(c->tagpool); /* reserve tag 0 */
if (err < 0) {
p9_idpool_destroy(c->tagpool);
goto error;
}
c->max_tag = 0;
error:
return err;
Expand Down Expand Up @@ -789,11 +790,13 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
spin_lock_init(&clnt->lock);
INIT_LIST_HEAD(&clnt->fidlist);

p9_tag_init(clnt);
err = p9_tag_init(clnt);
if (err < 0)
goto free_client;

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

if (!clnt->trans_mod)
clnt->trans_mod = v9fs_get_default_trans();
Expand All @@ -802,13 +805,12 @@ 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 free_client;
goto destroy_tagpool;
}

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

Expand All @@ -834,6 +836,8 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
p9_idpool_destroy(clnt->fidpool);
put_trans:
v9fs_put_trans(clnt->trans_mod);
destroy_tagpool:
p9_idpool_destroy(clnt->tagpool);
free_client:
kfree(clnt);
return ERR_PTR(err);
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/9p/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ int p9_idpool_get(struct p9_idpool *p)

retry:
if (idr_pre_get(&p->pool, GFP_NOFS) == 0)
return 0;
return -1;

spin_lock_irqsave(&p->lock, flags);

Expand Down

0 comments on commit 98a85a2

Please sign in to comment.