diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-02 20:42:39 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-04-03 17:50:23 -0400 |
commit | 0302f8762b9dc22102837e31370a1fa1e7fdb747 (patch) | |
tree | 97f464b6e7a08667fcb2f616dd2ef0855cbc6b4b | |
parent | 4317b2e12697aa19546ddeb0710a3094907de44f (diff) |
Revert "fs/9p: switch vfsmount to use v9fs_get_new_inode"9p-revert
This reverts commit fe1371d0f8c6a9aa4441ddd09ea6d4f31b975a81.
-rw-r--r-- | fs/9p/vfs_super.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/fs/9p/vfs_super.c b/fs/9p/vfs_super.c index 3e009baa1b11..941f7d0e0bfa 100644 --- a/fs/9p/vfs_super.c +++ b/fs/9p/vfs_super.c @@ -110,6 +110,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, struct inode *inode = NULL; struct dentry *root = NULL; struct v9fs_session_info *v9ses = NULL; + umode_t mode = 0777 | S_ISVTX; struct p9_fid *fid; int retval = 0; @@ -139,7 +140,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, else sb->s_d_op = &v9fs_dentry_operations; - inode = v9fs_get_new_inode_from_fid(v9ses, fid, sb); + inode = v9fs_get_inode(sb, S_IFDIR | mode, 0); if (IS_ERR(inode)) { retval = PTR_ERR(inode); goto release_sb; @@ -151,6 +152,32 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags, goto release_sb; } sb->s_root = root; + if (v9fs_proto_dotl(v9ses)) { + struct p9_stat_dotl *st = NULL; + + st = p9_client_getattr_dotl(fid, P9_STATS_BASIC); + if (IS_ERR(st)) { + retval = PTR_ERR(st); + goto release_sb; + } + d_inode(root)->i_ino = v9fs_qid2ino(&st->qid); + v9fs_stat2inode_dotl(st, d_inode(root), 0); + kfree(st); + } else { + struct p9_wstat *st = NULL; + + st = p9_client_stat(fid); + if (IS_ERR(st)) { + retval = PTR_ERR(st); + goto release_sb; + } + + d_inode(root)->i_ino = v9fs_qid2ino(&st->qid); + v9fs_stat2inode(st, d_inode(root), sb, 0); + + p9stat_free(st); + kfree(st); + } retval = v9fs_get_acl(inode, fid); if (retval) goto release_sb; |