@@ -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;