diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-27 16:05:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-27 16:05:09 -0500 |
commit | 1751e8a6cb935e555fcdbcb9ab4f0446e322ca3e (patch) | |
tree | 83c57e4aeda0665cb131de862364b7a5cfd7dd66 /fs/ntfs/super.c | |
parent | 141cbfba1d0502006463aa80f57c64086226af1a (diff) |
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: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ntfs/super.c')
-rw-r--r-- | fs/ntfs/super.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c index 3f70f041dbe9..bb7159f697f2 100644 --- a/fs/ntfs/super.c +++ b/fs/ntfs/super.c | |||
@@ -473,7 +473,7 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt) | |||
473 | 473 | ||
474 | #ifndef NTFS_RW | 474 | #ifndef NTFS_RW |
475 | /* For read-only compiled driver, enforce read-only flag. */ | 475 | /* For read-only compiled driver, enforce read-only flag. */ |
476 | *flags |= MS_RDONLY; | 476 | *flags |= SB_RDONLY; |
477 | #else /* NTFS_RW */ | 477 | #else /* NTFS_RW */ |
478 | /* | 478 | /* |
479 | * For the read-write compiled driver, if we are remounting read-write, | 479 | * For the read-write compiled driver, if we are remounting read-write, |
@@ -487,7 +487,7 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt) | |||
487 | * When remounting read-only, mark the volume clean if no volume errors | 487 | * When remounting read-only, mark the volume clean if no volume errors |
488 | * have occurred. | 488 | * have occurred. |
489 | */ | 489 | */ |
490 | if (sb_rdonly(sb) && !(*flags & MS_RDONLY)) { | 490 | if (sb_rdonly(sb) && !(*flags & SB_RDONLY)) { |
491 | static const char *es = ". Cannot remount read-write."; | 491 | static const char *es = ". Cannot remount read-write."; |
492 | 492 | ||
493 | /* Remounting read-write. */ | 493 | /* Remounting read-write. */ |
@@ -548,7 +548,7 @@ static int ntfs_remount(struct super_block *sb, int *flags, char *opt) | |||
548 | NVolSetErrors(vol); | 548 | NVolSetErrors(vol); |
549 | return -EROFS; | 549 | return -EROFS; |
550 | } | 550 | } |
551 | } else if (!sb_rdonly(sb) && (*flags & MS_RDONLY)) { | 551 | } else if (!sb_rdonly(sb) && (*flags & SB_RDONLY)) { |
552 | /* Remounting read-only. */ | 552 | /* Remounting read-only. */ |
553 | if (!NVolErrors(vol)) { | 553 | if (!NVolErrors(vol)) { |
554 | if (ntfs_clear_volume_flags(vol, VOLUME_IS_DIRTY)) | 554 | if (ntfs_clear_volume_flags(vol, VOLUME_IS_DIRTY)) |
@@ -1799,7 +1799,7 @@ static bool load_system_files(ntfs_volume *vol) | |||
1799 | es3); | 1799 | es3); |
1800 | goto iput_mirr_err_out; | 1800 | goto iput_mirr_err_out; |
1801 | } | 1801 | } |
1802 | sb->s_flags |= MS_RDONLY; | 1802 | sb->s_flags |= SB_RDONLY; |
1803 | ntfs_error(sb, "%s. Mounting read-only%s", | 1803 | ntfs_error(sb, "%s. Mounting read-only%s", |
1804 | !vol->mftmirr_ino ? es1 : es2, es3); | 1804 | !vol->mftmirr_ino ? es1 : es2, es3); |
1805 | } else | 1805 | } else |
@@ -1937,7 +1937,7 @@ get_ctx_vol_failed: | |||
1937 | es1, es2); | 1937 | es1, es2); |
1938 | goto iput_vol_err_out; | 1938 | goto iput_vol_err_out; |
1939 | } | 1939 | } |
1940 | sb->s_flags |= MS_RDONLY; | 1940 | sb->s_flags |= SB_RDONLY; |
1941 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 1941 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
1942 | } else | 1942 | } else |
1943 | ntfs_warning(sb, "%s. Will not be able to remount " | 1943 | ntfs_warning(sb, "%s. Will not be able to remount " |
@@ -1974,7 +1974,7 @@ get_ctx_vol_failed: | |||
1974 | } | 1974 | } |
1975 | goto iput_logfile_err_out; | 1975 | goto iput_logfile_err_out; |
1976 | } | 1976 | } |
1977 | sb->s_flags |= MS_RDONLY; | 1977 | sb->s_flags |= SB_RDONLY; |
1978 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 1978 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
1979 | } else | 1979 | } else |
1980 | ntfs_warning(sb, "%s. Will not be able to remount " | 1980 | ntfs_warning(sb, "%s. Will not be able to remount " |
@@ -2019,7 +2019,7 @@ get_ctx_vol_failed: | |||
2019 | es1, es2); | 2019 | es1, es2); |
2020 | goto iput_root_err_out; | 2020 | goto iput_root_err_out; |
2021 | } | 2021 | } |
2022 | sb->s_flags |= MS_RDONLY; | 2022 | sb->s_flags |= SB_RDONLY; |
2023 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2023 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
2024 | } else | 2024 | } else |
2025 | ntfs_warning(sb, "%s. Will not be able to remount " | 2025 | ntfs_warning(sb, "%s. Will not be able to remount " |
@@ -2042,7 +2042,7 @@ get_ctx_vol_failed: | |||
2042 | goto iput_root_err_out; | 2042 | goto iput_root_err_out; |
2043 | } | 2043 | } |
2044 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2044 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
2045 | sb->s_flags |= MS_RDONLY; | 2045 | sb->s_flags |= SB_RDONLY; |
2046 | /* | 2046 | /* |
2047 | * Do not set NVolErrors() because ntfs_remount() might manage | 2047 | * Do not set NVolErrors() because ntfs_remount() might manage |
2048 | * to set the dirty flag in which case all would be well. | 2048 | * to set the dirty flag in which case all would be well. |
@@ -2055,7 +2055,7 @@ get_ctx_vol_failed: | |||
2055 | * If (still) a read-write mount, set the NT4 compatibility flag on | 2055 | * If (still) a read-write mount, set the NT4 compatibility flag on |
2056 | * newer NTFS version volumes. | 2056 | * newer NTFS version volumes. |
2057 | */ | 2057 | */ |
2058 | if (!(sb->s_flags & MS_RDONLY) && (vol->major_ver > 1) && | 2058 | if (!(sb->s_flags & SB_RDONLY) && (vol->major_ver > 1) && |
2059 | ntfs_set_volume_flags(vol, VOLUME_MOUNTED_ON_NT4)) { | 2059 | ntfs_set_volume_flags(vol, VOLUME_MOUNTED_ON_NT4)) { |
2060 | static const char *es1 = "Failed to set NT4 compatibility flag"; | 2060 | static const char *es1 = "Failed to set NT4 compatibility flag"; |
2061 | static const char *es2 = ". Run chkdsk."; | 2061 | static const char *es2 = ". Run chkdsk."; |
@@ -2069,7 +2069,7 @@ get_ctx_vol_failed: | |||
2069 | goto iput_root_err_out; | 2069 | goto iput_root_err_out; |
2070 | } | 2070 | } |
2071 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2071 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
2072 | sb->s_flags |= MS_RDONLY; | 2072 | sb->s_flags |= SB_RDONLY; |
2073 | NVolSetErrors(vol); | 2073 | NVolSetErrors(vol); |
2074 | } | 2074 | } |
2075 | #endif | 2075 | #endif |
@@ -2087,7 +2087,7 @@ get_ctx_vol_failed: | |||
2087 | goto iput_root_err_out; | 2087 | goto iput_root_err_out; |
2088 | } | 2088 | } |
2089 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2089 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
2090 | sb->s_flags |= MS_RDONLY; | 2090 | sb->s_flags |= SB_RDONLY; |
2091 | NVolSetErrors(vol); | 2091 | NVolSetErrors(vol); |
2092 | } | 2092 | } |
2093 | #endif /* NTFS_RW */ | 2093 | #endif /* NTFS_RW */ |
@@ -2128,7 +2128,7 @@ get_ctx_vol_failed: | |||
2128 | es1, es2); | 2128 | es1, es2); |
2129 | goto iput_quota_err_out; | 2129 | goto iput_quota_err_out; |
2130 | } | 2130 | } |
2131 | sb->s_flags |= MS_RDONLY; | 2131 | sb->s_flags |= SB_RDONLY; |
2132 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2132 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
2133 | } else | 2133 | } else |
2134 | ntfs_warning(sb, "%s. Will not be able to remount " | 2134 | ntfs_warning(sb, "%s. Will not be able to remount " |
@@ -2150,7 +2150,7 @@ get_ctx_vol_failed: | |||
2150 | goto iput_quota_err_out; | 2150 | goto iput_quota_err_out; |
2151 | } | 2151 | } |
2152 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2152 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
2153 | sb->s_flags |= MS_RDONLY; | 2153 | sb->s_flags |= SB_RDONLY; |
2154 | NVolSetErrors(vol); | 2154 | NVolSetErrors(vol); |
2155 | } | 2155 | } |
2156 | /* | 2156 | /* |
@@ -2171,7 +2171,7 @@ get_ctx_vol_failed: | |||
2171 | es1, es2); | 2171 | es1, es2); |
2172 | goto iput_usnjrnl_err_out; | 2172 | goto iput_usnjrnl_err_out; |
2173 | } | 2173 | } |
2174 | sb->s_flags |= MS_RDONLY; | 2174 | sb->s_flags |= SB_RDONLY; |
2175 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2175 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
2176 | } else | 2176 | } else |
2177 | ntfs_warning(sb, "%s. Will not be able to remount " | 2177 | ntfs_warning(sb, "%s. Will not be able to remount " |
@@ -2194,7 +2194,7 @@ get_ctx_vol_failed: | |||
2194 | goto iput_usnjrnl_err_out; | 2194 | goto iput_usnjrnl_err_out; |
2195 | } | 2195 | } |
2196 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); | 2196 | ntfs_error(sb, "%s. Mounting read-only%s", es1, es2); |
2197 | sb->s_flags |= MS_RDONLY; | 2197 | sb->s_flags |= SB_RDONLY; |
2198 | NVolSetErrors(vol); | 2198 | NVolSetErrors(vol); |
2199 | } | 2199 | } |
2200 | #endif /* NTFS_RW */ | 2200 | #endif /* NTFS_RW */ |
@@ -2728,7 +2728,7 @@ static int ntfs_fill_super(struct super_block *sb, void *opt, const int silent) | |||
2728 | lockdep_off(); | 2728 | lockdep_off(); |
2729 | ntfs_debug("Entering."); | 2729 | ntfs_debug("Entering."); |
2730 | #ifndef NTFS_RW | 2730 | #ifndef NTFS_RW |
2731 | sb->s_flags |= MS_RDONLY; | 2731 | sb->s_flags |= SB_RDONLY; |
2732 | #endif /* ! NTFS_RW */ | 2732 | #endif /* ! NTFS_RW */ |
2733 | /* Allocate a new ntfs_volume and place it in sb->s_fs_info. */ | 2733 | /* Allocate a new ntfs_volume and place it in sb->s_fs_info. */ |
2734 | sb->s_fs_info = kmalloc(sizeof(ntfs_volume), GFP_NOFS); | 2734 | sb->s_fs_info = kmalloc(sizeof(ntfs_volume), GFP_NOFS); |