Skip to content

Commit 6bb2932

Browse files
committed
fs/9p: remove walk and inode allocation from symlink
Symlink had a bunch of extra operations which essentially end up discarded. It was walking the fid to the new file and creating an inode for it, but those semantics are part of tsymlink. This did prepopulate the cache, but that also seems potentially unnecessary and frought with peril. Signed-off-by: Eric Van Hensbergen <[email protected]>
1 parent 44c53ac commit 6bb2932

File tree

1 file changed

+0
-33
lines changed

1 file changed

+0
-33
lines changed

fs/9p/vfs_inode_dotl.c

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -694,14 +694,11 @@ v9fs_vfs_symlink_dotl(struct mnt_idmap *idmap, struct inode *dir,
694694
kgid_t gid;
695695
const unsigned char *name;
696696
struct p9_qid qid;
697-
struct inode *inode;
698697
struct p9_fid *dfid;
699698
struct p9_fid *fid = NULL;
700-
struct v9fs_session_info *v9ses;
701699

702700
name = dentry->d_name.name;
703701
p9_debug(P9_DEBUG_VFS, "%lu,%s,%s\n", dir->i_ino, name, symname);
704-
v9ses = v9fs_inode2v9ses(dir);
705702

706703
dfid = v9fs_parent_fid(dentry);
707704
if (IS_ERR(dfid)) {
@@ -721,36 +718,6 @@ v9fs_vfs_symlink_dotl(struct mnt_idmap *idmap, struct inode *dir,
721718
}
722719

723720
v9fs_invalidate_inode_attr(dir);
724-
if (v9ses->cache & (CACHE_META|CACHE_LOOSE)) {
725-
/* Now walk from the parent so we can get an unopened fid. */
726-
fid = p9_client_walk(dfid, 1, &name, 1);
727-
if (IS_ERR(fid)) {
728-
err = PTR_ERR(fid);
729-
p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
730-
err);
731-
goto error;
732-
}
733-
734-
/* instantiate inode and assign the unopened fid to dentry */
735-
inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
736-
if (IS_ERR(inode)) {
737-
err = PTR_ERR(inode);
738-
p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
739-
err);
740-
goto error;
741-
}
742-
v9fs_fid_add(dentry, &fid);
743-
d_instantiate(dentry, inode);
744-
err = 0;
745-
} else {
746-
/* Not in cached mode. No need to populate inode with stat */
747-
inode = v9fs_get_inode(dir->i_sb, S_IFLNK, 0);
748-
if (IS_ERR(inode)) {
749-
err = PTR_ERR(inode);
750-
goto error;
751-
}
752-
d_instantiate(dentry, inode);
753-
}
754721

755722
error:
756723
p9_fid_put(fid);

0 commit comments

Comments
 (0)