Harshad Shirwadkar | 6866d7b | 2020-10-15 13:37:55 -0700 | [diff] [blame] | 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" |
Harshad Shirwadkar | ff780b9 | 2020-10-15 13:37:56 -0700 | [diff] [blame^] | 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 | } |
Harshad Shirwadkar | 6866d7b | 2020-10-15 13:37:55 -0700 | [diff] [blame] | 18 | |
| 19 | void ext4_fc_init(struct super_block *sb, journal_t *journal) |
| 20 | { |
| 21 | if (!test_opt2(sb, JOURNAL_FAST_COMMIT)) |
| 22 | return; |
Harshad Shirwadkar | ff780b9 | 2020-10-15 13:37:56 -0700 | [diff] [blame^] | 23 | journal->j_fc_cleanup_callback = ext4_fc_cleanup; |
Harshad Shirwadkar | 6866d7b | 2020-10-15 13:37:55 -0700 | [diff] [blame] | 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 | } |