aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/super.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 88f812eddff6..5dc54ae5ac81 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1191,11 +1191,14 @@ static void btrfs_resize_thread_pool(struct btrfs_fs_info *fs_info,
1191 new_pool_size); 1191 new_pool_size);
1192} 1192}
1193 1193
1194static inline void btrfs_remount_prepare(struct btrfs_fs_info *fs_info, 1194static inline void btrfs_remount_prepare(struct btrfs_fs_info *fs_info)
1195 unsigned long old_opts, int flags)
1196{ 1195{
1197 set_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state); 1196 set_bit(BTRFS_FS_STATE_REMOUNTING, &fs_info->fs_state);
1197}
1198 1198
1199static inline void btrfs_remount_begin(struct btrfs_fs_info *fs_info,
1200 unsigned long old_opts, int flags)
1201{
1199 if (btrfs_raw_test_opt(old_opts, AUTO_DEFRAG) && 1202 if (btrfs_raw_test_opt(old_opts, AUTO_DEFRAG) &&
1200 (!btrfs_raw_test_opt(fs_info->mount_opt, AUTO_DEFRAG) || 1203 (!btrfs_raw_test_opt(fs_info->mount_opt, AUTO_DEFRAG) ||
1201 (flags & MS_RDONLY))) { 1204 (flags & MS_RDONLY))) {
@@ -1236,7 +1239,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
1236 unsigned int old_metadata_ratio = fs_info->metadata_ratio; 1239 unsigned int old_metadata_ratio = fs_info->metadata_ratio;
1237 int ret; 1240 int ret;
1238 1241
1239 btrfs_remount_prepare(fs_info, old_opts, *flags); 1242 btrfs_remount_prepare(fs_info);
1240 1243
1241 ret = btrfs_parse_options(root, data); 1244 ret = btrfs_parse_options(root, data);
1242 if (ret) { 1245 if (ret) {
@@ -1244,6 +1247,7 @@ static int btrfs_remount(struct super_block *sb, int *flags, char *data)
1244 goto restore; 1247 goto restore;
1245 } 1248 }
1246 1249
1250 btrfs_remount_begin(fs_info, old_opts, *flags);
1247 btrfs_resize_thread_pool(fs_info, 1251 btrfs_resize_thread_pool(fs_info,
1248 fs_info->thread_pool_size, old_thread_pool_size); 1252 fs_info->thread_pool_size, old_thread_pool_size);
1249 1253