浏览代码

Unroll essentials of do_remount_sb() into devpts

On remount, devpts fs only needs to parse the mount options. Users cannot
directly create/dirty files in /dev/pts so the MS_RDONLY flag and
shrinking the dcache does not really apply to devpts.

So effectively on remount, devpts only parses the mount options and updates
these options in its super block. As such, we could replace do_remount_sb()
call with a direct parse_mount_options().

Doing so enables subsequent patches to avoid parsing the mount options twice
and simplify the code.

Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Sukadev Bhattiprolu 16 年之前
父节点
当前提交
fdbf534866
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      fs/devpts/inode.c

+ 6 - 1
fs/devpts/inode.c

@@ -437,6 +437,8 @@ static int get_init_pts_sb(struct file_system_type *fs_type, int flags,
 		void *data, struct vfsmount *mnt)
 		void *data, struct vfsmount *mnt)
 {
 {
 	struct super_block *s;
 	struct super_block *s;
+	struct pts_mount_opts *opts;
+	struct pts_fs_info *fsi;
 	int error;
 	int error;
 
 
 	s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
 	s = sget(fs_type, compare_init_pts_sb, set_anon_super, NULL);
@@ -453,7 +455,10 @@ static int get_init_pts_sb(struct file_system_type *fs_type, int flags,
 		}
 		}
 		s->s_flags |= MS_ACTIVE;
 		s->s_flags |= MS_ACTIVE;
 	}
 	}
-	do_remount_sb(s, flags, data, 0);
+	fsi = DEVPTS_SB(s);
+	opts = &fsi->mount_opts;
+	parse_mount_options(data, PARSE_REMOUNT, opts);
+
 	simple_set_mnt(mnt, s);
 	simple_set_mnt(mnt, s);
 	return 0;
 	return 0;
 }
 }