Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1751e8a6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Rename superblock flags (MS_xyz -> SB_xyz)



This is a pure automated search-and-replace of the internal kernel
superblock flags.

The s_flags are now called SB_*, with the names and the values for the
moment mirroring the MS_* flags that they're equivalent to.

Note how the MS_xyz flags are the ones passed to the mount system call,
while the SB_xyz flags are what we then use in sb->s_flags.

The script to do this was:

    # places to look in; re security/*: it generally should *not* be
    # touched (that stuff parses mount(2) arguments directly), but
    # there are two places where we really deal with superblock flags.
    FILES="drivers/mtd drivers/staging/lustre fs ipc mm \
            include/linux/fs.h include/uapi/linux/bfs_fs.h \
            security/apparmor/apparmorfs.c security/apparmor/include/lib.h"
    # the list of MS_... constants
    SYMS="RDONLY NOSUID NODEV NOEXEC SYNCHRONOUS REMOUNT MANDLOCK \
          DIRSYNC NOATIME NODIRATIME BIND MOVE REC VERBOSE SILENT \
          POSIXACL UNBINDABLE PRIVATE SLAVE SHARED RELATIME KERNMOUNT \
          I_VERSION STRICTATIME LAZYTIME SUBMOUNT NOREMOTELOCK NOSEC BORN \
          ACTIVE NOUSER"

    SED_PROG=
    for i in $SYMS; do SED_PROG="$SED_PROG -e s/MS_$i/SB_$i/g"; done

    # we want files that contain at least one of MS_...,
    # with fs/namespace.c and fs/pnode.c excluded.
    L=$(for i in $SYMS; do git grep -w -l MS_$i $FILES; done| sort|uniq|grep -v '^fs/namespace.c'|grep -v '^fs/pnode.c')

    for f in $L; do sed -i $f $SED_PROG; done

Requested-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 141cbfba
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -79,14 +79,14 @@ static struct dentry *mount_mtd_aux(struct file_system_type *fs_type, int flags,
	pr_debug("MTDSB: New superblock for device %d (\"%s\")\n",
	      mtd->index, mtd->name);

	ret = fill_super(sb, data, flags & MS_SILENT ? 1 : 0);
	ret = fill_super(sb, data, flags & SB_SILENT ? 1 : 0);
	if (ret < 0) {
		deactivate_locked_super(sb);
		return ERR_PTR(ret);
	}

	/* go */
	sb->s_flags |= MS_ACTIVE;
	sb->s_flags |= SB_ACTIVE;
	return dget(sb->s_root);

	/* new mountpoint for an already mounted superblock */
@@ -202,7 +202,7 @@ struct dentry *mount_mtd(struct file_system_type *fs_type, int flags,
not_an_MTD_device:
#endif /* CONFIG_BLOCK */

	if (!(flags & MS_SILENT))
	if (!(flags & SB_SILENT))
		printk(KERN_NOTICE
		       "MTD: Attempt to mount non-MTD device \"%s\"\n",
		       dev_name);
+1 −1
Original line number Diff line number Diff line
@@ -1016,7 +1016,7 @@ static bool file_is_noatime(const struct file *file)
	if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
		return true;

	if ((inode->i_sb->s_flags & MS_NODIRATIME) && S_ISDIR(inode->i_mode))
	if ((inode->i_sb->s_flags & SB_NODIRATIME) && S_ISDIR(inode->i_mode))
		return true;

	return false;
+7 −7
Original line number Diff line number Diff line
@@ -313,11 +313,11 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
	}

	if (data->ocd_connect_flags & OBD_CONNECT_ACL) {
		sb->s_flags |= MS_POSIXACL;
		sb->s_flags |= SB_POSIXACL;
		sbi->ll_flags |= LL_SBI_ACL;
	} else {
		LCONSOLE_INFO("client wants to enable acl, but mdt not!\n");
		sb->s_flags &= ~MS_POSIXACL;
		sb->s_flags &= ~SB_POSIXACL;
		sbi->ll_flags &= ~LL_SBI_ACL;
	}

@@ -660,7 +660,7 @@ void ll_kill_super(struct super_block *sb)
	struct ll_sb_info *sbi;

	/* not init sb ?*/
	if (!(sb->s_flags & MS_ACTIVE))
	if (!(sb->s_flags & SB_ACTIVE))
		return;

	sbi = ll_s2sbi(sb);
@@ -2039,8 +2039,8 @@ int ll_remount_fs(struct super_block *sb, int *flags, char *data)
	int err;
	__u32 read_only;

	if ((bool)(*flags & MS_RDONLY) != sb_rdonly(sb)) {
		read_only = *flags & MS_RDONLY;
	if ((bool)(*flags & SB_RDONLY) != sb_rdonly(sb)) {
		read_only = *flags & SB_RDONLY;
		err = obd_set_info_async(NULL, sbi->ll_md_exp,
					 sizeof(KEY_READ_ONLY),
					 KEY_READ_ONLY, sizeof(read_only),
@@ -2053,9 +2053,9 @@ int ll_remount_fs(struct super_block *sb, int *flags, char *data)
		}

		if (read_only)
			sb->s_flags |= MS_RDONLY;
			sb->s_flags |= SB_RDONLY;
		else
			sb->s_flags &= ~MS_RDONLY;
			sb->s_flags &= ~SB_RDONLY;

		if (sbi->ll_flags & LL_SBI_VERBOSE)
			LCONSOLE_WARN("Remounted %s %s\n", profilenm,
+3 −3
Original line number Diff line number Diff line
@@ -94,13 +94,13 @@ v9fs_fill_super(struct super_block *sb, struct v9fs_session_info *v9ses,
	if (v9ses->cache)
		sb->s_bdi->ra_pages = (VM_MAX_READAHEAD * 1024)/PAGE_SIZE;

	sb->s_flags |= MS_ACTIVE | MS_DIRSYNC | MS_NOATIME;
	sb->s_flags |= SB_ACTIVE | SB_DIRSYNC | SB_NOATIME;
	if (!v9ses->cache)
		sb->s_flags |= MS_SYNCHRONOUS;
		sb->s_flags |= SB_SYNCHRONOUS;

#ifdef CONFIG_9P_FS_POSIX_ACL
	if ((v9ses->flags & V9FS_ACL_MASK) == V9FS_POSIX_ACL)
		sb->s_flags |= MS_POSIXACL;
		sb->s_flags |= SB_POSIXACL;
#endif

	return 0;
+2 −2
Original line number Diff line number Diff line
@@ -213,7 +213,7 @@ static int parse_options(struct super_block *sb, char *options)
static int adfs_remount(struct super_block *sb, int *flags, char *data)
{
	sync_filesystem(sb);
	*flags |= MS_NODIRATIME;
	*flags |= SB_NODIRATIME;
	return parse_options(sb, data);
}

@@ -372,7 +372,7 @@ static int adfs_fill_super(struct super_block *sb, void *data, int silent)
	struct inode *root;
	int ret = -EINVAL;

	sb->s_flags |= MS_NODIRATIME;
	sb->s_flags |= SB_NODIRATIME;

	asb = kzalloc(sizeof(*asb), GFP_KERNEL);
	if (!asb)
Loading