aboutsummaryrefslogtreecommitdiffstats
path: root/fs/affs/super.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-07-17 03:45:34 -0400
committerDavid Howells <dhowells@redhat.com>2017-07-17 03:45:34 -0400
commitbc98a42c1f7d0f886c0c1b75a92a004976a46d9f (patch)
tree42a30f4f8d1aa3723f5356f2a5697b23317e2e19 /fs/affs/super.c
parent94e92e7ac90d06e1e839e112d3ae80b2457dbdd7 (diff)
VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb)
Firstly by applying the following with coccinelle's spatch: @@ expression SB; @@ -SB->s_flags & MS_RDONLY +sb_rdonly(SB) to effect the conversion to sb_rdonly(sb), then by applying: @@ expression A, SB; @@ ( -(!sb_rdonly(SB)) && A +!sb_rdonly(SB) && A | -A != (sb_rdonly(SB)) +A != sb_rdonly(SB) | -A == (sb_rdonly(SB)) +A == sb_rdonly(SB) | -!(sb_rdonly(SB)) +!sb_rdonly(SB) | -A && (sb_rdonly(SB)) +A && sb_rdonly(SB) | -A || (sb_rdonly(SB)) +A || sb_rdonly(SB) | -(sb_rdonly(SB)) != A +sb_rdonly(SB) != A | -(sb_rdonly(SB)) == A +sb_rdonly(SB) == A | -(sb_rdonly(SB)) && A +sb_rdonly(SB) && A | -(sb_rdonly(SB)) || A +sb_rdonly(SB) || A ) @@ expression A, B, SB; @@ ( -(sb_rdonly(SB)) ? 1 : 0 +sb_rdonly(SB) | -(sb_rdonly(SB)) ? A : B +sb_rdonly(SB) ? A : B ) to remove left over excess bracketage and finally by applying: @@ expression A, SB; @@ ( -(A & MS_RDONLY) != sb_rdonly(SB) +(bool)(A & MS_RDONLY) != sb_rdonly(SB) | -(A & MS_RDONLY) == sb_rdonly(SB) +(bool)(A & MS_RDONLY) == sb_rdonly(SB) ) to make comparisons against the result of sb_rdonly() (which is a bool) work correctly. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/affs/super.c')
-rw-r--r--fs/affs/super.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/affs/super.c b/fs/affs/super.c
index 7bf47a41cb4f..884bedab7266 100644
--- a/fs/affs/super.c
+++ b/fs/affs/super.c
@@ -80,7 +80,7 @@ void affs_mark_sb_dirty(struct super_block *sb)
80 struct affs_sb_info *sbi = AFFS_SB(sb); 80 struct affs_sb_info *sbi = AFFS_SB(sb);
81 unsigned long delay; 81 unsigned long delay;
82 82
83 if (sb->s_flags & MS_RDONLY) 83 if (sb_rdonly(sb))
84 return; 84 return;
85 85
86 spin_lock(&sbi->work_lock); 86 spin_lock(&sbi->work_lock);
@@ -464,7 +464,7 @@ got_root:
464 * not recommended. 464 * not recommended.
465 */ 465 */
466 if ((chksum == FS_DCFFS || chksum == MUFS_DCFFS || chksum == FS_DCOFS 466 if ((chksum == FS_DCFFS || chksum == MUFS_DCFFS || chksum == FS_DCOFS
467 || chksum == MUFS_DCOFS) && !(sb->s_flags & MS_RDONLY)) { 467 || chksum == MUFS_DCOFS) && !sb_rdonly(sb)) {
468 pr_notice("Dircache FS - mounting %s read only\n", sb->s_id); 468 pr_notice("Dircache FS - mounting %s read only\n", sb->s_id);
469 sb->s_flags |= MS_RDONLY; 469 sb->s_flags |= MS_RDONLY;
470 } 470 }
@@ -596,7 +596,7 @@ affs_remount(struct super_block *sb, int *flags, char *data)
596 memcpy(sbi->s_volume, volume, 32); 596 memcpy(sbi->s_volume, volume, 32);
597 spin_unlock(&sbi->symlink_lock); 597 spin_unlock(&sbi->symlink_lock);
598 598
599 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) 599 if ((bool)(*flags & MS_RDONLY) == sb_rdonly(sb))
600 return 0; 600 return 0;
601 601
602 if (*flags & MS_RDONLY) 602 if (*flags & MS_RDONLY)