Skip to content

Commit 53af8ee

Browse files
Sukadev Bhattiprolutorvalds
authored andcommitted
Extract option parsing to new function
Move code to parse mount options into a separate function so it can (later) be shared between mount and remount operations. Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 31af0ab commit 53af8ee

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎fs/devpts/inode.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,9 @@ static inline struct super_block *pts_sb_from_inode(struct inode *inode)
7272
return devpts_mnt->mnt_sb;
7373
}
7474

75-
static int devpts_remount(struct super_block *sb, int *flags, char *data)
75+
static int parse_mount_options(char *data, struct pts_mount_opts *opts)
7676
{
7777
char *p;
78-
struct pts_fs_info *fsi = DEVPTS_SB(sb);
79-
struct pts_mount_opts *opts = &fsi->mount_opts;
8078

8179
opts->setuid = 0;
8280
opts->setgid = 0;
@@ -120,6 +118,14 @@ static int devpts_remount(struct super_block *sb, int *flags, char *data)
120118
return 0;
121119
}
122120

121+
static int devpts_remount(struct super_block *sb, int *flags, char *data)
122+
{
123+
struct pts_fs_info *fsi = DEVPTS_SB(sb);
124+
struct pts_mount_opts *opts = &fsi->mount_opts;
125+
126+
return parse_mount_options(data, opts);
127+
}
128+
123129
static int devpts_show_options(struct seq_file *seq, struct vfsmount *vfs)
124130
{
125131
struct pts_fs_info *fsi = DEVPTS_SB(vfs->mnt_sb);

0 commit comments

Comments
 (0)