Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[sfrench/cifs-2.6.git] / fs / ext2 / super.c
index fc18edd81815d1307fe311032c849e583c431f5f..1458706bd2ec6ac5ed9c0acb6c150d661bd14595 100644 (file)
@@ -52,7 +52,7 @@ void ext2_error(struct super_block *sb, const char *function,
        struct ext2_sb_info *sbi = EXT2_SB(sb);
        struct ext2_super_block *es = sbi->s_es;
 
-       if (!(sb->s_flags & MS_RDONLY)) {
+       if (!sb_rdonly(sb)) {
                spin_lock(&sbi->s_lock);
                sbi->s_mount_state |= EXT2_ERROR_FS;
                es->s_state |= cpu_to_le16(EXT2_ERROR_FS);
@@ -151,7 +151,7 @@ static void ext2_put_super (struct super_block * sb)
                ext2_xattr_destroy_cache(sbi->s_ea_block_cache);
                sbi->s_ea_block_cache = NULL;
        }
-       if (!(sb->s_flags & MS_RDONLY)) {
+       if (!sb_rdonly(sb)) {
                struct ext2_super_block *es = sbi->s_es;
 
                spin_lock(&sbi->s_lock);
@@ -943,8 +943,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
                        le32_to_cpu(features));
                goto failed_mount;
        }
-       if (!(sb->s_flags & MS_RDONLY) &&
-           (features = EXT2_HAS_RO_COMPAT_FEATURE(sb, ~EXT2_FEATURE_RO_COMPAT_SUPP))){
+       if (!sb_rdonly(sb) && (features = EXT2_HAS_RO_COMPAT_FEATURE(sb, ~EXT2_FEATURE_RO_COMPAT_SUPP))){
                ext2_msg(sb, KERN_ERR, "error: couldn't mount RDWR because of "
                       "unsupported optional features (%x)",
                       le32_to_cpu(features));
@@ -1173,7 +1172,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
        if (EXT2_HAS_COMPAT_FEATURE(sb, EXT3_FEATURE_COMPAT_HAS_JOURNAL))
                ext2_msg(sb, KERN_WARNING,
                        "warning: mounting ext3 filesystem as ext2");
-       if (ext2_setup_super (sb, es, sb->s_flags & MS_RDONLY))
+       if (ext2_setup_super (sb, es, sb_rdonly(sb)))
                sb->s_flags |= MS_RDONLY;
        ext2_write_super(sb);
        return 0;
@@ -1305,7 +1304,7 @@ static int ext2_unfreeze(struct super_block *sb)
 
 static void ext2_write_super(struct super_block *sb)
 {
-       if (!(sb->s_flags & MS_RDONLY))
+       if (!sb_rdonly(sb))
                ext2_sync_fs(sb, 1);
 }
 
@@ -1343,7 +1342,7 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
                         "dax flag with busy inodes while remounting");
                sbi->s_mount_opt ^= EXT2_MOUNT_DAX;
        }
-       if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) {
+       if ((bool)(*flags & MS_RDONLY) == sb_rdonly(sb)) {
                spin_unlock(&sbi->s_lock);
                return 0;
        }