VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb)
authorDavid Howells <dhowells@redhat.com>
Mon, 17 Jul 2017 07:45:34 +0000 (08:45 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 17 Jul 2017 07:45:34 +0000 (08:45 +0100)
commitbc98a42c1f7d0f886c0c1b75a92a004976a46d9f
tree42a30f4f8d1aa3723f5356f2a5697b23317e2e19
parent94e92e7ac90d06e1e839e112d3ae80b2457dbdd7
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>
74 files changed:
drivers/staging/lustre/lustre/llite/llite_lib.c
drivers/staging/lustre/lustre/llite/namei.c
fs/affs/amigaffs.c
fs/affs/bitmap.c
fs/affs/super.c
fs/befs/linuxvfs.c
fs/btrfs/dev-replace.c
fs/btrfs/disk-io.c
fs/btrfs/extent_io.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/root-tree.c
fs/btrfs/super.c
fs/btrfs/sysfs.c
fs/btrfs/volumes.c
fs/cachefiles/bind.c
fs/ecryptfs/main.c
fs/efs/super.c
fs/ext2/super.c
fs/ext4/ext4_jbd2.c
fs/ext4/file.c
fs/ext4/fsync.c
fs/ext4/ialloc.c
fs/ext4/mmp.c
fs/ext4/super.c
fs/fat/fatent.c
fs/fat/inode.c
fs/fat/misc.c
fs/gfs2/glops.c
fs/gfs2/ops_fstype.c
fs/gfs2/quota.c
fs/gfs2/recovery.c
fs/gfs2/super.c
fs/gfs2/sys.c
fs/hfs/mdb.c
fs/hfs/super.c
fs/hfsplus/super.c
fs/hpfs/alloc.c
fs/hpfs/dir.c
fs/hpfs/super.c
fs/isofs/inode.c
fs/jffs2/fs.c
fs/jffs2/super.c
fs/jffs2/wbuf.c
fs/jfs/jfs_mount.c
fs/jfs/super.c
fs/minix/inode.c
fs/namei.c
fs/namespace.c
fs/nfs/super.c
fs/nilfs2/inode.c
fs/nilfs2/mdt.c
fs/nilfs2/super.c
fs/ntfs/super.c
fs/ocfs2/super.c
fs/overlayfs/super.c
fs/proc_namespace.c
fs/quota/quota.c
fs/reiserfs/inode.c
fs/reiserfs/journal.c
fs/reiserfs/prints.c
fs/reiserfs/super.c
fs/super.c
fs/sync.c
fs/sysv/balloc.c
fs/sysv/ialloc.c
fs/sysv/inode.c
fs/sysv/super.c
fs/ubifs/super.c
fs/udf/super.c
fs/ufs/super.c
fs/xfs/xfs_quotaops.c
fs/xfs/xfs_super.c
init/do_mounts.c