Skip to content

Commit

Permalink
Extract option parsing to new function
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Alan Cox <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Sukadev Bhattiprolu authored and torvalds committed Jan 2, 2009
1 parent 31af0ab commit 53af8ee
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fs/devpts/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@ static inline struct super_block *pts_sb_from_inode(struct inode *inode)
return devpts_mnt->mnt_sb;
}

static int devpts_remount(struct super_block *sb, int *flags, char *data)
static int parse_mount_options(char *data, struct pts_mount_opts *opts)
{
char *p;
struct pts_fs_info *fsi = DEVPTS_SB(sb);
struct pts_mount_opts *opts = &fsi->mount_opts;

opts->setuid = 0;
opts->setgid = 0;
Expand Down Expand Up @@ -120,6 +118,14 @@ static int devpts_remount(struct super_block *sb, int *flags, char *data)
return 0;
}

static int devpts_remount(struct super_block *sb, int *flags, char *data)
{
struct pts_fs_info *fsi = DEVPTS_SB(sb);
struct pts_mount_opts *opts = &fsi->mount_opts;

return parse_mount_options(data, opts);
}

static int devpts_show_options(struct seq_file *seq, struct vfsmount *vfs)
{
struct pts_fs_info *fsi = DEVPTS_SB(vfs->mnt_sb);
Expand Down

0 comments on commit 53af8ee

Please sign in to comment.