aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>2010-05-10 14:08:28 -0400
committerEric Van Hensbergen <ericvh@gmail.com>2010-05-22 13:39:02 -0400
commit6d27e64d74e14c1cf2b4af438d7e8a77017bd654 (patch)
tree8b402bf58da42297521ec12bb024be566790cd6a
parentfe5bd0736bcdf35bd6cc300211a97c2fef8bd83e (diff)
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: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
-rw-r--r--fs/9p/vfs_inode.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index aecfc0c17945..0ba2db44e0b8 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -504,12 +504,11 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
504 ofid = NULL; 504 ofid = NULL;
505 fid = NULL; 505 fid = NULL;
506 name = (char *) dentry->d_name.name; 506 name = (char *) dentry->d_name.name;
507 dfid = v9fs_fid_clone(dentry->d_parent); 507 dfid = v9fs_fid_lookup(dentry->d_parent);
508 if (IS_ERR(dfid)) { 508 if (IS_ERR(dfid)) {
509 err = PTR_ERR(dfid); 509 err = PTR_ERR(dfid);
510 P9_DPRINTK(P9_DEBUG_VFS, "fid clone failed %d\n", err); 510 P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
511 dfid = NULL; 511 return ERR_PTR(err);
512 goto error;
513 } 512 }
514 513
515 /* clone a fid to use for creation */ 514 /* clone a fid to use for creation */
@@ -517,8 +516,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
517 if (IS_ERR(ofid)) { 516 if (IS_ERR(ofid)) {
518 err = PTR_ERR(ofid); 517 err = PTR_ERR(ofid);
519 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); 518 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
520 ofid = NULL; 519 return ERR_PTR(err);
521 goto error;
522 } 520 }
523 521
524 err = p9_client_fcreate(ofid, name, perm, mode, extension); 522 err = p9_client_fcreate(ofid, name, perm, mode, extension);
@@ -528,14 +526,13 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
528 } 526 }
529 527
530 /* now walk from the parent so we can get unopened fid */ 528 /* now walk from the parent so we can get unopened fid */
531 fid = p9_client_walk(dfid, 1, &name, 0); 529 fid = p9_client_walk(dfid, 1, &name, 1);
532 if (IS_ERR(fid)) { 530 if (IS_ERR(fid)) {
533 err = PTR_ERR(fid); 531 err = PTR_ERR(fid);
534 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); 532 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
535 fid = NULL; 533 fid = NULL;
536 goto error; 534 goto error;
537 } else 535 }
538 dfid = NULL;
539 536
540 /* instantiate inode and assign the unopened fid to the dentry */ 537 /* instantiate inode and assign the unopened fid to the dentry */
541 inode = v9fs_inode_from_fid(v9ses, fid, dir->i_sb); 538 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 return ofid; 555 return ofid;
559 556
560error: 557error:
561 if (dfid)
562 p9_client_clunk(dfid);
563
564 if (ofid) 558 if (ofid)
565 p9_client_clunk(ofid); 559 p9_client_clunk(ofid);
566 560