summaryrefslogtreecommitdiffstats
path: root/fs/ext2/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext2/super.c')
-rw-r--r--fs/ext2/super.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index fc18edd81815..1458706bd2ec 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -52,7 +52,7 @@ void ext2_error(struct super_block *sb, const char *function,
52 struct ext2_sb_info *sbi = EXT2_SB(sb); 52 struct ext2_sb_info *sbi = EXT2_SB(sb);
53 struct ext2_super_block *es = sbi->s_es; 53 struct ext2_super_block *es = sbi->s_es;
54 54
55 if (!(sb->s_flags & MS_RDONLY)) { 55 if (!sb_rdonly(sb)) {
56 spin_lock(&sbi->s_lock); 56 spin_lock(&sbi->s_lock);
57 sbi->s_mount_state |= EXT2_ERROR_FS; 57 sbi->s_mount_state |= EXT2_ERROR_FS;
58 es->s_state |= cpu_to_le16(EXT2_ERROR_FS); 58 es->s_state |= cpu_to_le16(EXT2_ERROR_FS);
@@ -151,7 +151,7 @@ static void ext2_put_super (struct super_block * sb)
151 ext2_xattr_destroy_cache(sbi->s_ea_block_cache); 151 ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
152 sbi->s_ea_block_cache = NULL; 152 sbi->s_ea_block_cache = NULL;
153 } 153 }
154 if (!(sb->s_flags & MS_RDONLY)) { 154 if (!sb_rdonly(sb)) {
155 struct ext2_super_block *es = sbi->s_es; 155 struct ext2_super_block *es = sbi->s_es;
156 156
157 spin_lock(&sbi->s_lock); 157 spin_lock(&sbi->s_lock);
@@ -943,8 +943,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
943 le32_to_cpu(features)); 943 le32_to_cpu(features));
944 goto failed_mount; 944 goto failed_mount;
945 } 945 }
946 if (!(sb->s_flags & MS_RDONLY) && 946 if (!sb_rdonly(sb) && (features = EXT2_HAS_RO_COMPAT_FEATURE(sb, ~EXT2_FEATURE_RO_COMPAT_SUPP))){
947 (features = EXT2_HAS_RO_COMPAT_FEATURE(sb, ~EXT2_FEATURE_RO_COMPAT_SUPP))){
948 ext2_msg(sb, KERN_ERR, "error: couldn't mount RDWR because of " 947 ext2_msg(sb, KERN_ERR, "error: couldn't mount RDWR because of "
949 "unsupported optional features (%x)", 948 "unsupported optional features (%x)",
950 le32_to_cpu(features)); 949 le32_to_cpu(features));
@@ -1173,7 +1172,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
1173 if (EXT2_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL)) 1172 if (EXT2_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL))
1174 ext2_msg(sb, KERN_WARNING, 1173 ext2_msg(sb, KERN_WARNING,
1175 "warning: mounting ext3 filesystem as ext2"); 1174 "warning: mounting ext3 filesystem as ext2");
1176 if (ext2_setup_super (sb, es, sb->s_flags & MS_RDONLY)) 1175 if (ext2_setup_super (sb, es, sb_rdonly(sb)))
1177 sb->s_flags |= MS_RDONLY; 1176 sb->s_flags |= MS_RDONLY;
1178 ext2_write_super(sb); 1177 ext2_write_super(sb);
1179 return 0; 1178 return 0;
@@ -1305,7 +1304,7 @@ static int ext2_unfreeze(struct super_block *sb)
1305 1304
1306static void ext2_write_super(struct super_block *sb) 1305static void ext2_write_super(struct super_block *sb)
1307{ 1306{
1308 if (!(sb->s_flags & MS_RDONLY)) 1307 if (!sb_rdonly(sb))
1309 ext2_sync_fs(sb, 1); 1308 ext2_sync_fs(sb, 1);
1310} 1309}
1311 1310
@@ -1343,7 +1342,7 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
1343 "dax flag with busy inodes while remounting"); 1342 "dax flag with busy inodes while remounting");
1344 sbi->s_mount_opt ^= EXT2_MOUNT_DAX; 1343 sbi->s_mount_opt ^= EXT2_MOUNT_DAX;
1345 } 1344 }
1346 if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) { 1345 if ((bool)(*flags & MS_RDONLY) == sb_rdonly(sb)) {
1347 spin_unlock(&sbi->s_lock); 1346 spin_unlock(&sbi->s_lock);
1348 return 0; 1347 return 0;
1349 } 1348 }