]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/btrfs/super.c
VFS: Convert sb->s_flags & MS_RDONLY to sb_rdonly(sb)
[mirror_ubuntu-bionic-kernel.git] / fs / btrfs / super.c
index 74e47794e63ffdda6921f8445bd4f576f22f1434..086819312a44f743256e5f4855e3421447c99fef 100644 (file)
@@ -102,7 +102,7 @@ static void btrfs_handle_error(struct btrfs_fs_info *fs_info)
 {
        struct super_block *sb = fs_info->sb;
 
-       if (sb->s_flags & MS_RDONLY)
+       if (sb_rdonly(sb))
                return;
 
        if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) {
@@ -138,7 +138,7 @@ void __btrfs_handle_fs_error(struct btrfs_fs_info *fs_info, const char *function
         * Special case: if the error is EROFS, and we're already
         * under MS_RDONLY, then it is safe here.
         */
-       if (errno == -EROFS && (sb->s_flags & MS_RDONLY))
+       if (errno == -EROFS && sb_rdonly(sb))
                return;
 
 #ifdef CONFIG_PRINTK
@@ -1154,7 +1154,6 @@ static int btrfs_fill_super(struct super_block *sb,
                goto fail_close;
        }
 
-       save_mount_options(sb, data);
        cleancache_init_fs(sb);
        sb->s_flags |= MS_ACTIVE;
        return 0;
@@ -1688,8 +1687,7 @@ static inline void btrfs_remount_cleanup(struct btrfs_fs_info *fs_info,
         * close or the filesystem is read only.
         */
        if (btrfs_raw_test_opt(old_opts, AUTO_DEFRAG) &&
-           (!btrfs_raw_test_opt(fs_info->mount_opt, AUTO_DEFRAG) ||
-            (fs_info->sb->s_flags & MS_RDONLY))) {
+           (!btrfs_raw_test_opt(fs_info->mount_opt, AUTO_DEFRAG) || sb_rdonly(fs_info->sb))) {
                btrfs_cleanup_defrag_inodes(fs_info);
        }
 
@@ -1736,7 +1734,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
        btrfs_resize_thread_pool(fs_info,
                fs_info->thread_pool_size, old_thread_pool_size);
 
-       if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY))
+       if ((bool)(*flags & MS_RDONLY) == sb_rdonly(sb))
                goto out;
 
        if (*flags & MS_RDONLY) {
@@ -1836,7 +1834,7 @@ out:
 
 restore:
        /* We've hit an error - don't reset MS_RDONLY */
-       if (sb->s_flags & MS_RDONLY)
+       if (sb_rdonly(sb))
                old_flags |= MS_RDONLY;
        sb->s_flags = old_flags;
        fs_info->mount_opt = old_opts;