ext4: clean up the JBD2 API that initializes fast commits
authorHarshad Shirwadkar <harshadshirwadkar@gmail.com>
Fri, 6 Nov 2020 03:58:55 +0000 (19:58 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 7 Nov 2020 04:01:03 +0000 (23:01 -0500)
commita1e5e465b31d6015fccb359d99053b39e5180466
tree2f996837b5e750345915bc37e0433508a1e21a78
parentede7dc7fa0af619afc08995776eadb9ff3b0a711
ext4: clean up the JBD2 API that initializes fast commits

This patch removes jbd2_fc_init() API and its related functions to
simplify enabling fast commits. With this change, the number of fast
commit blocks to use is solely determined by the JBD2 layer. So, we
move the default value for minimum number of fast commit blocks from
ext4/fast_commit.h to include/linux/jbd2.h. However, whether or not to
use fast commits is determined by the file system. The file system
just sets the fast commit feature using
jbd2_journal_set_features(). JBD2 layer then determines how many
blocks to use for fast commits (based on the value found in the JBD2
superblock).

Note that the JBD2 feature flag of fast commits is just an indication
that there are fast commit blocks present on disk. It doesn't tell
JBD2 layer about the intent of the file system of whether to it wants
to use fast commit or not. That's why, we blindly clear the fast
commit flag in journal_reset() after the recovery is done.

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Link: https://lore.kernel.org/r/20201106035911.1942128-7-harshadshirwadkar@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/fast_commit.c
fs/ext4/fast_commit.h
fs/ext4/super.c
fs/jbd2/journal.c
include/linux/jbd2.h