summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.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/btrfs/disk-io.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/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 080e2ebb8aa0..4a9b40f604fa 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -2478,7 +2478,7 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info,
2478 return ret; 2478 return ret;
2479 } 2479 }
2480 2480
2481 if (fs_info->sb->s_flags & MS_RDONLY) { 2481 if (sb_rdonly(fs_info->sb)) {
2482 ret = btrfs_commit_super(fs_info); 2482 ret = btrfs_commit_super(fs_info);
2483 if (ret) 2483 if (ret)
2484 return ret; 2484 return ret;
@@ -2874,7 +2874,7 @@ int open_ctree(struct super_block *sb,
2874 2874
2875 features = btrfs_super_compat_ro_flags(disk_super) & 2875 features = btrfs_super_compat_ro_flags(disk_super) &
2876 ~BTRFS_FEATURE_COMPAT_RO_SUPP; 2876 ~BTRFS_FEATURE_COMPAT_RO_SUPP;
2877 if (!(sb->s_flags & MS_RDONLY) && features) { 2877 if (!sb_rdonly(sb) && features) {
2878 btrfs_err(fs_info, 2878 btrfs_err(fs_info,
2879 "cannot mount read-write because of unsupported optional features (%llx)", 2879 "cannot mount read-write because of unsupported optional features (%llx)",
2880 features); 2880 features);
@@ -3039,7 +3039,7 @@ retry_root_backup:
3039 btrfs_calc_num_tolerated_disk_barrier_failures(fs_info); 3039 btrfs_calc_num_tolerated_disk_barrier_failures(fs_info);
3040 if (fs_info->fs_devices->missing_devices > 3040 if (fs_info->fs_devices->missing_devices >
3041 fs_info->num_tolerated_disk_barrier_failures && 3041 fs_info->num_tolerated_disk_barrier_failures &&
3042 !(sb->s_flags & MS_RDONLY)) { 3042 !sb_rdonly(sb)) {
3043 btrfs_warn(fs_info, 3043 btrfs_warn(fs_info,
3044"missing devices (%llu) exceeds the limit (%d), writeable mount is not allowed", 3044"missing devices (%llu) exceeds the limit (%d), writeable mount is not allowed",
3045 fs_info->fs_devices->missing_devices, 3045 fs_info->fs_devices->missing_devices,
@@ -3102,7 +3102,7 @@ retry_root_backup:
3102 if (ret) 3102 if (ret)
3103 goto fail_qgroup; 3103 goto fail_qgroup;
3104 3104
3105 if (!(sb->s_flags & MS_RDONLY)) { 3105 if (!sb_rdonly(sb)) {
3106 ret = btrfs_cleanup_fs_roots(fs_info); 3106 ret = btrfs_cleanup_fs_roots(fs_info);
3107 if (ret) 3107 if (ret)
3108 goto fail_qgroup; 3108 goto fail_qgroup;
@@ -3128,7 +3128,7 @@ retry_root_backup:
3128 goto fail_qgroup; 3128 goto fail_qgroup;
3129 } 3129 }
3130 3130
3131 if (sb->s_flags & MS_RDONLY) 3131 if (sb_rdonly(sb))
3132 return 0; 3132 return 0;
3133 3133
3134 if (btrfs_test_opt(fs_info, CLEAR_CACHE) && 3134 if (btrfs_test_opt(fs_info, CLEAR_CACHE) &&
@@ -3928,7 +3928,7 @@ void close_ctree(struct btrfs_fs_info *fs_info)
3928 3928
3929 cancel_work_sync(&fs_info->async_reclaim_work); 3929 cancel_work_sync(&fs_info->async_reclaim_work);
3930 3930
3931 if (!(fs_info->sb->s_flags & MS_RDONLY)) { 3931 if (!sb_rdonly(fs_info->sb)) {
3932 /* 3932 /*
3933 * If the cleaner thread is stopped and there are 3933 * If the cleaner thread is stopped and there are
3934 * block groups queued for removal, the deletion will be 3934 * block groups queued for removal, the deletion will be