f2fs: enable flush_merge only in f2fs is not read-only
authorGu Zheng <guz.fnst@cn.fujitsu.com>
Fri, 11 Apr 2014 09:49:55 +0000 (17:49 +0800)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Wed, 7 May 2014 01:21:54 +0000 (10:21 +0900)
Enable flush_merge only in f2fs is not read-only, so does the mount
option show.

Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/segment.c
fs/f2fs/super.c

index ba067b1b81078da8a3b3b7289493d01d489e3c9a..1e264e761f71f3dd28134d2a6f07fd8b538ca701 100644 (file)
@@ -1859,10 +1859,9 @@ int build_segment_manager(struct f2fs_sb_info *sbi)
        sm_info->nr_discards = 0;
        sm_info->max_discards = 0;
 
-       if (test_opt(sbi, FLUSH_MERGE)) {
+       if (test_opt(sbi, FLUSH_MERGE) && !f2fs_readonly(sbi->sb)) {
                spin_lock_init(&sm_info->issue_lock);
                init_waitqueue_head(&sm_info->flush_wait_queue);
-
                sm_info->f2fs_issue_flush = kthread_run(issue_flush_thread, sbi,
                                "f2fs_flush-%u:%u", MAJOR(dev), MINOR(dev));
                if (IS_ERR(sm_info->f2fs_issue_flush))
index c756923a7302cc6dc144e108a11a4d2ceb5800ed..5e20d2a36eac401cf3de1137b38e0d857e3ab975 100644 (file)
@@ -514,7 +514,7 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
 {
        struct f2fs_sb_info *sbi = F2FS_SB(root->d_sb);
 
-       if (!(root->d_sb->s_flags & MS_RDONLY) && test_opt(sbi, BG_GC))
+       if (!f2fs_readonly(sbi->sb) && test_opt(sbi, BG_GC))
                seq_printf(seq, ",background_gc=%s", "on");
        else
                seq_printf(seq, ",background_gc=%s", "off");
@@ -542,7 +542,7 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root)
                seq_puts(seq, ",disable_ext_identify");
        if (test_opt(sbi, INLINE_DATA))
                seq_puts(seq, ",inline_data");
-       if (test_opt(sbi, FLUSH_MERGE))
+       if (!f2fs_readonly(sbi->sb) && test_opt(sbi, FLUSH_MERGE))
                seq_puts(seq, ",flush_merge");
        seq_printf(seq, ",active_logs=%u", sbi->active_logs);