Commit | Line | Data |
---|---|---|
6866d7b3 HS |
1 | // 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" | |
ff780b91 HS |
11 | /* |
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 | */ | |
15 | static void ext4_fc_cleanup(journal_t *journal, int full) | |
16 | { | |
17 | } | |
6866d7b3 HS |
18 | |
19 | void ext4_fc_init(struct super_block *sb, journal_t *journal) | |
20 | { | |
21 | if (!test_opt2(sb, JOURNAL_FAST_COMMIT)) | |
22 | return; | |
ff780b91 | 23 | journal->j_fc_cleanup_callback = ext4_fc_cleanup; |
6866d7b3 HS |
24 | 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 | } |