Commit 6d27e64d authored by Venkateswararao Jujjuri's avatar Venkateswararao Jujjuri Committed by Eric Van Hensbergen

9p: Optimize TCREATE by eliminating a redundant fid clone.

This patch removes a redundant fid clone on the directory fid and hence
reduces a server transaction while creating new filesystem object.
Signed-off-by: default avatarVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent fe5bd073
...@@ -504,12 +504,11 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir, ...@@ -504,12 +504,11 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
ofid = NULL; ofid = NULL;
fid = NULL; fid = NULL;
name = (char *) dentry->d_name.name; name = (char *) dentry->d_name.name;
dfid = v9fs_fid_clone(dentry->d_parent); dfid = v9fs_fid_lookup(dentry->d_parent);
if (IS_ERR(dfid)) { if (IS_ERR(dfid)) {
err = PTR_ERR(dfid); err = PTR_ERR(dfid);
P9_DPRINTK(P9_DEBUG_VFS, "fid clone failed %d\n", err); P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
dfid = NULL; return ERR_PTR(err);
goto error;
} }
/* clone a fid to use for creation */ /* clone a fid to use for creation */
...@@ -517,8 +516,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir, ...@@ -517,8 +516,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
if (IS_ERR(ofid)) { if (IS_ERR(ofid)) {
err = PTR_ERR(ofid); err = PTR_ERR(ofid);
P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
ofid = NULL; return ERR_PTR(err);
goto error;
} }
err = p9_client_fcreate(ofid, name, perm, mode, extension); err = p9_client_fcreate(ofid, name, perm, mode, extension);
...@@ -528,14 +526,13 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir, ...@@ -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 */ /* 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)) { if (IS_ERR(fid)) {
err = PTR_ERR(fid); err = PTR_ERR(fid);
P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
fid = NULL; fid = NULL;
goto error; goto error;
} else }
dfid = NULL;
/* instantiate inode and assign the unopened fid to the dentry */ /* instantiate inode and assign the unopened fid to the dentry */
inode = v9fs_inode_from_fid(v9ses, fid, dir->i_sb); inode = v9fs_inode_from_fid(v9ses, fid, dir->i_sb);
...@@ -558,9 +555,6 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir, ...@@ -558,9 +555,6 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
return ofid; return ofid;
error: error:
if (dfid)
p9_client_clunk(dfid);
if (ofid) if (ofid)
p9_client_clunk(ofid); p9_client_clunk(ofid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment