blob: f2d11b4c6b6266cae539a9b3301ea1df08f350ef [file] [log] [blame]
Harshad Shirwadkar6866d7b2020-10-15 13:37:55 -07001// SPDX-License-Identifier: GPL-2.0
2
3/*
4 * fs/ext4/fast_commit.c
5 *
6 * Written by Harshad Shirwadkar <harshadshirwadkar@gmail.com>
7 *
8 * Ext4 fast commits routines.
9 */
10#include "ext4_jbd2.h"
Harshad Shirwadkarff780b92020-10-15 13:37:56 -070011/*
12 * Fast commit cleanup routine. This is called after every fast commit and
13 * full commit. full is true if we are called after a full commit.
14 */
15static void ext4_fc_cleanup(journal_t *journal, int full)
16{
17}
Harshad Shirwadkar6866d7b2020-10-15 13:37:55 -070018
19void ext4_fc_init(struct super_block *sb, journal_t *journal)
20{
21 if (!test_opt2(sb, JOURNAL_FAST_COMMIT))
22 return;
Harshad Shirwadkarff780b92020-10-15 13:37:56 -070023 journal->j_fc_cleanup_callback = ext4_fc_cleanup;
Harshad Shirwadkar6866d7b2020-10-15 13:37:55 -070024 if (jbd2_fc_init(journal, EXT4_NUM_FC_BLKS)) {
25 pr_warn("Error while enabling fast commits, turning off.");
26 ext4_clear_feature_fast_commit(sb);
27 }
28}