Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198104
b: refs/heads/master
c: 6d27e64
h: refs/heads/master
v: v3
  • Loading branch information
Venkateswararao Jujjuri authored and Eric Van Hensbergen committed May 22, 2010
1 parent d04d126 commit ea5b958
Show file tree
Hide file tree
Showing 2 changed files with 7 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: fe5bd0736bcdf35bd6cc300211a97c2fef8bd83e
refs/heads/master: 6d27e64d74e14c1cf2b4af438d7e8a77017bd654
18 changes: 6 additions & 12 deletions trunk/fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,21 +504,19 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
ofid = NULL;
fid = NULL;
name = (char *) dentry->d_name.name;
dfid = v9fs_fid_clone(dentry->d_parent);
dfid = v9fs_fid_lookup(dentry->d_parent);
if (IS_ERR(dfid)) {
err = PTR_ERR(dfid);
P9_DPRINTK(P9_DEBUG_VFS, "fid clone failed %d\n", err);
dfid = NULL;
goto error;
P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
return ERR_PTR(err);
}

/* clone a fid to use for creation */
ofid = p9_client_walk(dfid, 0, NULL, 1);
if (IS_ERR(ofid)) {
err = PTR_ERR(ofid);
P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
ofid = NULL;
goto error;
return ERR_PTR(err);
}

err = p9_client_fcreate(ofid, name, perm, mode, extension);
Expand All @@ -528,14 +526,13 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
}

/* now walk from the parent so we can get unopened fid */
fid = p9_client_walk(dfid, 1, &name, 0);
fid = p9_client_walk(dfid, 1, &name, 1);
if (IS_ERR(fid)) {
err = PTR_ERR(fid);
P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
fid = NULL;
goto error;
} else
dfid = NULL;
}

/* instantiate inode and assign the unopened fid to the dentry */
inode = v9fs_inode_from_fid(v9ses, fid, dir->i_sb);
Expand All @@ -558,9 +555,6 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
return ofid;

error:
if (dfid)
p9_client_clunk(dfid);

if (ofid)
p9_client_clunk(ofid);

Expand Down

0 comments on commit ea5b958

Please sign in to comment.