summaryrefslogtreecommitdiffstats
path: root/fs/libfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/libfs.c')
-rw-r--r--fs/libfs.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/libfs.c b/fs/libfs.c
index 4b59b1816efb..030e545f586e 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -239,14 +239,12 @@ static const struct super_operations simple_super_operations = {
239 * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that 239 * Common helper for pseudo-filesystems (sockfs, pipefs, bdev - stuff that
240 * will never be mountable) 240 * will never be mountable)
241 */ 241 */
242struct dentry *mount_pseudo_xattr(struct file_system_type *fs_type, char *name, 242struct dentry *mount_pseudo_xattr(struct file_system_type *fs_type,
243 const struct super_operations *ops, const struct xattr_handler **xattr, 243 const struct super_operations *ops, const struct xattr_handler **xattr,
244 const struct dentry_operations *dops, unsigned long magic) 244 const struct dentry_operations *dops, unsigned long magic)
245{ 245{
246 struct super_block *s; 246 struct super_block *s;
247 struct dentry *dentry;
248 struct inode *root; 247 struct inode *root;
249 struct qstr d_name = QSTR_INIT(name, strlen(name));
250 248
251 s = sget_userns(fs_type, NULL, set_anon_super, SB_KERNMOUNT|SB_NOUSER, 249 s = sget_userns(fs_type, NULL, set_anon_super, SB_KERNMOUNT|SB_NOUSER,
252 &init_user_ns, NULL); 250 &init_user_ns, NULL);
@@ -271,13 +269,9 @@ struct dentry *mount_pseudo_xattr(struct file_system_type *fs_type, char *name,
271 root->i_ino = 1; 269 root->i_ino = 1;
272 root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR; 270 root->i_mode = S_IFDIR | S_IRUSR | S_IWUSR;
273 root->i_atime = root->i_mtime = root->i_ctime = current_time(root); 271 root->i_atime = root->i_mtime = root->i_ctime = current_time(root);
274 dentry = __d_alloc(s, &d_name); 272 s->s_root = d_make_root(root);
275 if (!dentry) { 273 if (!s->s_root)
276 iput(root);
277 goto Enomem; 274 goto Enomem;
278 }
279 d_instantiate(dentry, root);
280 s->s_root = dentry;
281 s->s_d_op = dops; 275 s->s_d_op = dops;
282 s->s_flags |= SB_ACTIVE; 276 s->s_flags |= SB_ACTIVE;
283 return dget(s->s_root); 277 return dget(s->s_root);