Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[firefly-linux-kernel-4.4.55.git] / fs / ocfs2 / super.c
index 706c71c2955d2bab37660d54c65a56448253e1b1..26675185b88688c1c8b7571eed45cd06f1d70eca 100644 (file)
@@ -191,6 +191,7 @@ enum {
        Opt_coherency_full,
        Opt_resv_level,
        Opt_dir_resv_level,
+       Opt_journal_async_commit,
        Opt_err,
 };
 
@@ -222,6 +223,7 @@ static const match_table_t tokens = {
        {Opt_coherency_full, "coherency=full"},
        {Opt_resv_level, "resv_level=%u"},
        {Opt_dir_resv_level, "dir_resv_level=%u"},
+       {Opt_journal_async_commit, "journal_async_commit"},
        {Opt_err, NULL}
 };
 
@@ -1470,6 +1472,9 @@ static int ocfs2_parse_options(struct super_block *sb,
                            option < OCFS2_MAX_RESV_LEVEL)
                                mopt->dir_resv_level = option;
                        break;
+               case Opt_journal_async_commit:
+                       mopt->mount_opt |= OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT;
+                       break;
                default:
                        mlog(ML_ERROR,
                             "Unrecognized mount option \"%s\" "
@@ -1576,6 +1581,9 @@ static int ocfs2_show_options(struct seq_file *s, struct dentry *root)
        if (osb->osb_dir_resv_level != osb->osb_resv_level)
                seq_printf(s, ",dir_resv_level=%d", osb->osb_resv_level);
 
+       if (opts & OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT)
+               seq_printf(s, ",journal_async_commit");
+
        return 0;
 }
 
@@ -1738,6 +1746,8 @@ static void ocfs2_inode_init_once(void *data)
        ocfs2_lock_res_init_once(&oi->ip_inode_lockres);
        ocfs2_lock_res_init_once(&oi->ip_open_lockres);
 
+       init_waitqueue_head(&oi->append_dio_wq);
+
        ocfs2_metadata_cache_init(INODE_CACHE(&oi->vfs_inode),
                                  &ocfs2_inode_caching_ops);
 
@@ -2445,6 +2455,15 @@ static int ocfs2_check_volume(struct ocfs2_super *osb)
                goto finally;
        }
 
+       if (osb->s_mount_opt & OCFS2_MOUNT_JOURNAL_ASYNC_COMMIT)
+               jbd2_journal_set_features(osb->journal->j_journal,
+                               JBD2_FEATURE_COMPAT_CHECKSUM, 0,
+                               JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT);
+       else
+               jbd2_journal_clear_features(osb->journal->j_journal,
+                               JBD2_FEATURE_COMPAT_CHECKSUM, 0,
+                               JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT);
+
        if (dirty) {
                /* recover my local alloc if we didn't unmount cleanly. */
                status = ocfs2_begin_local_alloc_recovery(osb,