Commit 7dd17f71 authored by Eric W. Biederman's avatar Eric W. Biederman

devpts: Move the creation of /dev/pts/ptmx into fill_super

The code makes more sense here and things are just clearer.
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 20890479
...@@ -425,11 +425,19 @@ devpts_fill_super(struct super_block *s, void *data, int silent) ...@@ -425,11 +425,19 @@ devpts_fill_super(struct super_block *s, void *data, int silent)
set_nlink(inode, 2); set_nlink(inode, 2);
s->s_root = d_make_root(inode); s->s_root = d_make_root(inode);
if (s->s_root) if (!s->s_root) {
return 0; pr_err("get root dentry failed\n");
goto fail;
}
pr_err("get root dentry failed\n"); error = mknod_ptmx(s);
if (error)
goto fail_dput;
return 0;
fail_dput:
dput(s->s_root);
s->s_root = NULL;
fail: fail:
return error; return error;
} }
...@@ -456,11 +464,6 @@ static struct dentry *devpts_mount(struct file_system_type *fs_type, ...@@ -456,11 +464,6 @@ static struct dentry *devpts_mount(struct file_system_type *fs_type,
goto out_undo_sget; goto out_undo_sget;
s->s_flags |= MS_ACTIVE; s->s_flags |= MS_ACTIVE;
} }
error = mknod_ptmx(s);
if (error)
goto out_undo_sget;
return dget(s->s_root); return dget(s->s_root);
out_undo_sget: out_undo_sget:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment