Skip to content

Commit 2dc92e5

Browse files
committed
fs/9p: Eliminate redundant non-cache path in mknod
Like symlink, mknod had a seperate path with different inode allocation -- but this seems unnecessary, so eliminating this path. Signed-off-by: Eric Van Hensbergen <[email protected]>
1 parent 6bb2932 commit 2dc92e5

File tree

1 file changed

+10
-26
lines changed

1 file changed

+10
-26
lines changed

fs/9p/vfs_inode_dotl.c

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -840,33 +840,17 @@ v9fs_vfs_mknod_dotl(struct mnt_idmap *idmap, struct inode *dir,
840840
err);
841841
goto error;
842842
}
843-
844-
/* instantiate inode and assign the unopened fid to the dentry */
845-
if (v9ses->cache & (CACHE_META|CACHE_LOOSE)) {
846-
inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
847-
if (IS_ERR(inode)) {
848-
err = PTR_ERR(inode);
849-
p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
850-
err);
851-
goto error;
852-
}
853-
v9fs_set_create_acl(inode, fid, dacl, pacl);
854-
v9fs_fid_add(dentry, &fid);
855-
d_instantiate(dentry, inode);
856-
err = 0;
857-
} else {
858-
/*
859-
* Not in cached mode. No need to populate inode with stat.
860-
* socket syscall returns a fd, so we need instantiate
861-
*/
862-
inode = v9fs_get_inode(dir->i_sb, mode, rdev);
863-
if (IS_ERR(inode)) {
864-
err = PTR_ERR(inode);
865-
goto error;
866-
}
867-
v9fs_set_create_acl(inode, fid, dacl, pacl);
868-
d_instantiate(dentry, inode);
843+
inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
844+
if (IS_ERR(inode)) {
845+
err = PTR_ERR(inode);
846+
p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
847+
err);
848+
goto error;
869849
}
850+
v9fs_set_create_acl(inode, fid, dacl, pacl);
851+
v9fs_fid_add(dentry, &fid);
852+
d_instantiate(dentry, inode);
853+
err = 0;
870854
error:
871855
p9_fid_put(fid);
872856
v9fs_put_acl(dacl, pacl);

0 commit comments

Comments
 (0)