diff mbox

[V9fs-developer] 9p: Optimize v9fs_create by eliminating additional fids and stat.

Message ID 1273421934-8238-1-git-send-email-jvrao@linux.vnet.ibm.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

jvrao May 9, 2010, 4:18 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index ec2bed4..443c51b 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -504,22 +504,13 @@  v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
 		goto error;
 	}
 
-	/* now walk from the parent so we can get unopened fid */
-	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;
-	} 
+	/*
+	 * Get an indoe and instantiate it in the dentry without any
+	 * fid or stat information. That information can be obtained
+	 * from the server when needed.
+	 */
 
-	/* instantiate inode and assign the unopened fid to the dentry */
-	inode = v9fs_inode_from_fid(v9ses, fid, dir->i_sb);
-	if (IS_ERR(inode)) {
-		err = PTR_ERR(inode);
-		P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err);
-		goto error;
-	}
+	inode = v9fs_get_inode(dir->i_sb, p9mode2unixmode(v9ses, mode));
 
 	if (v9ses->cache)
 		dentry->d_op = &v9fs_cached_dentry_operations;
@@ -527,7 +518,7 @@  v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
 		dentry->d_op = &v9fs_dentry_operations;
 
 	d_instantiate(dentry, inode);
-	err = v9fs_fid_add(dentry, fid);
+
 	if (err < 0)
 		goto error;