summaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/super.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-27 16:05:09 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-27 16:05:09 -0500
commit1751e8a6cb935e555fcdbcb9ab4f0446e322ca3e (patch)
tree83c57e4aeda0665cb131de862364b7a5cfd7dd66 /fs/hfsplus/super.c
parent141cbfba1d0502006463aa80f57c64086226af1a (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/hfsplus/super.c')
-rw-r--r--fs/hfsplus/super.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index e5bb2de2262a..1d458b716957 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -329,9 +329,9 @@ static int hfsplus_statfs(struct dentry *dentry, struct kstatfs *buf)
329static int hfsplus_remount(struct super_block *sb, int *flags, char *data) 329static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
330{ 330{
331 sync_filesystem(sb); 331 sync_filesystem(sb);
332 if ((bool)(*flags & MS_RDONLY) == sb_rdonly(sb)) 332 if ((bool)(*flags & SB_RDONLY) == sb_rdonly(sb))
333 return 0; 333 return 0;
334 if (!(*flags & MS_RDONLY)) { 334 if (!(*flags & SB_RDONLY)) {
335 struct hfsplus_vh *vhdr = HFSPLUS_SB(sb)->s_vhdr; 335 struct hfsplus_vh *vhdr = HFSPLUS_SB(sb)->s_vhdr;
336 int force = 0; 336 int force = 0;
337 337
@@ -340,20 +340,20 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
340 340
341 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { 341 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
342 pr_warn("filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. leaving read-only.\n"); 342 pr_warn("filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. leaving read-only.\n");
343 sb->s_flags |= MS_RDONLY; 343 sb->s_flags |= SB_RDONLY;
344 *flags |= MS_RDONLY; 344 *flags |= SB_RDONLY;
345 } else if (force) { 345 } else if (force) {
346 /* nothing */ 346 /* nothing */
347 } else if (vhdr->attributes & 347 } else if (vhdr->attributes &
348 cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 348 cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
349 pr_warn("filesystem is marked locked, leaving read-only.\n"); 349 pr_warn("filesystem is marked locked, leaving read-only.\n");
350 sb->s_flags |= MS_RDONLY; 350 sb->s_flags |= SB_RDONLY;
351 *flags |= MS_RDONLY; 351 *flags |= SB_RDONLY;
352 } else if (vhdr->attributes & 352 } else if (vhdr->attributes &
353 cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { 353 cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
354 pr_warn("filesystem is marked journaled, leaving read-only.\n"); 354 pr_warn("filesystem is marked journaled, leaving read-only.\n");
355 sb->s_flags |= MS_RDONLY; 355 sb->s_flags |= SB_RDONLY;
356 *flags |= MS_RDONLY; 356 *flags |= SB_RDONLY;
357 } 357 }
358 } 358 }
359 return 0; 359 return 0;
@@ -455,16 +455,16 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
455 455
456 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { 456 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
457 pr_warn("Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. mounting read-only.\n"); 457 pr_warn("Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. mounting read-only.\n");
458 sb->s_flags |= MS_RDONLY; 458 sb->s_flags |= SB_RDONLY;
459 } else if (test_and_clear_bit(HFSPLUS_SB_FORCE, &sbi->flags)) { 459 } else if (test_and_clear_bit(HFSPLUS_SB_FORCE, &sbi->flags)) {
460 /* nothing */ 460 /* nothing */
461 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 461 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
462 pr_warn("Filesystem is marked locked, mounting read-only.\n"); 462 pr_warn("Filesystem is marked locked, mounting read-only.\n");
463 sb->s_flags |= MS_RDONLY; 463 sb->s_flags |= SB_RDONLY;
464 } else if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) && 464 } else if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) &&
465 !sb_rdonly(sb)) { 465 !sb_rdonly(sb)) {
466 pr_warn("write access to a journaled filesystem is not supported, use the force option at your own risk, mounting read-only.\n"); 466 pr_warn("write access to a journaled filesystem is not supported, use the force option at your own risk, mounting read-only.\n");
467 sb->s_flags |= MS_RDONLY; 467 sb->s_flags |= SB_RDONLY;
468 } 468 }
469 469
470 err = -EINVAL; 470 err = -EINVAL;