diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2016-04-20 12:01:39 -0500 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2016-09-22 13:31:58 -0500 |
commit | 208904793abad8892422edad0e712f2d939c496b (patch) | |
tree | 3a45eb405b24ae5546894a38ba98c8af39d8d136 | |
parent | df75e7748bae1c7098bfa358485389b897f71305 (diff) | |
download | op-kernel-dev-208904793abad8892422edad0e712f2d939c496b.zip op-kernel-dev-208904793abad8892422edad0e712f2d939c496b.tar.gz |
devpts: Move parse_mount_options into fill_super
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
-rw-r--r-- | fs/devpts/inode.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index d116453..f582a4b 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -395,6 +395,7 @@ static int devpts_fill_super(struct super_block *s, void *data, int silent) { struct inode *inode; + int error; s->s_iflags &= ~SB_I_NODEV; s->s_blocksize = 1024; @@ -403,10 +404,16 @@ devpts_fill_super(struct super_block *s, void *data, int silent) s->s_op = &devpts_sops; s->s_time_gran = 1; + error = -ENOMEM; s->s_fs_info = new_pts_fs_info(s); if (!s->s_fs_info) goto fail; + error = parse_mount_options(data, PARSE_MOUNT, &DEVPTS_SB(s)->mount_opts); + if (error) + goto fail; + + error = -ENOMEM; inode = new_inode(s); if (!inode) goto fail; @@ -424,7 +431,7 @@ devpts_fill_super(struct super_block *s, void *data, int silent) pr_err("get root dentry failed\n"); fail: - return -ENOMEM; + return error; } /* @@ -437,13 +444,8 @@ static struct dentry *devpts_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data) { int error; - struct pts_mount_opts opts; struct super_block *s; - error = parse_mount_options(data, PARSE_MOUNT, &opts); - if (error) - return ERR_PTR(error); - s = sget(fs_type, NULL, set_anon_super, flags, NULL); if (IS_ERR(s)) return ERR_CAST(s); @@ -455,8 +457,6 @@ static struct dentry *devpts_mount(struct file_system_type *fs_type, s->s_flags |= MS_ACTIVE; } - memcpy(&(DEVPTS_SB(s))->mount_opts, &opts, sizeof(opts)); - error = mknod_ptmx(s); if (error) goto out_undo_sget; |