Skip to content

Commit fe1371d

Browse files
committed
fs/9p: switch vfsmount to use v9fs_get_new_inode
In the process of cleaning up inode number allocation, I noticed several functions which didn't use the standard helper allocators. This patch fixes the allocation in the mount entrypoint. Signed-off-by: Eric Van Hensbergen <[email protected]>
1 parent 6613476 commit fe1371d

File tree

1 file changed

+1
-28
lines changed

1 file changed

+1
-28
lines changed

fs/9p/vfs_super.c

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
110110
struct inode *inode = NULL;
111111
struct dentry *root = NULL;
112112
struct v9fs_session_info *v9ses = NULL;
113-
umode_t mode = 0777 | S_ISVTX;
114113
struct p9_fid *fid;
115114
int retval = 0;
116115

@@ -140,7 +139,7 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
140139
else
141140
sb->s_d_op = &v9fs_dentry_operations;
142141

143-
inode = v9fs_get_inode(sb, S_IFDIR | mode, 0);
142+
inode = v9fs_get_new_inode_from_fid(v9ses, fid, sb);
144143
if (IS_ERR(inode)) {
145144
retval = PTR_ERR(inode);
146145
goto release_sb;
@@ -152,32 +151,6 @@ static struct dentry *v9fs_mount(struct file_system_type *fs_type, int flags,
152151
goto release_sb;
153152
}
154153
sb->s_root = root;
155-
if (v9fs_proto_dotl(v9ses)) {
156-
struct p9_stat_dotl *st = NULL;
157-
158-
st = p9_client_getattr_dotl(fid, P9_STATS_BASIC);
159-
if (IS_ERR(st)) {
160-
retval = PTR_ERR(st);
161-
goto release_sb;
162-
}
163-
d_inode(root)->i_ino = v9fs_qid2ino(&st->qid);
164-
v9fs_stat2inode_dotl(st, d_inode(root), 0);
165-
kfree(st);
166-
} else {
167-
struct p9_wstat *st = NULL;
168-
169-
st = p9_client_stat(fid);
170-
if (IS_ERR(st)) {
171-
retval = PTR_ERR(st);
172-
goto release_sb;
173-
}
174-
175-
d_inode(root)->i_ino = v9fs_qid2ino(&st->qid);
176-
v9fs_stat2inode(st, d_inode(root), sb, 0);
177-
178-
p9stat_free(st);
179-
kfree(st);
180-
}
181154
retval = v9fs_get_acl(inode, fid);
182155
if (retval)
183156
goto release_sb;

0 commit comments

Comments
 (0)