summaryrefslogtreecommitdiff
path: root/e2fsck/journal.c
diff options
context:
space:
mode:
authorHarshad Shirwadkar <harshadshirwadkar@gmail.com>2021-01-21 21:44:59 -0800
committerTheodore Ts'o <tytso@mit.edu>2021-01-27 20:12:33 -0500
commitc8a097c2e13afe5d54b26c879b24eef084369774 (patch)
treee49d7d5956c9c9d80029fbc0d0906d5c14203a89 /e2fsck/journal.c
parent9dc54e46dbc9e85f3735b8288cf217ce3726bb56 (diff)
downloade2fsprogs-c8a097c2e13afe5d54b26c879b24eef084369774.tar.gz
e2fsck: add fast commit setup code
Introduce "e2fsck_fc_replay_state" structure which is needed for ext4 fast commit replay. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Reviewed-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'e2fsck/journal.c')
-rw-r--r--e2fsck/journal.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/e2fsck/journal.c b/e2fsck/journal.c
index 75fefcde..2c8e3441 100644
--- a/e2fsck/journal.c
+++ b/e2fsck/journal.c
@@ -278,6 +278,17 @@ static int process_journal_block(ext2_filsys fs,
return 0;
}
+/*
+ * Main recovery path entry point. This function returns JBD2_FC_REPLAY_CONTINUE
+ * to indicate that it is expecting more fast commit blocks. It returns
+ * JBD2_FC_REPLAY_STOP to indicate that replay is done.
+ */
+static int ext4_fc_replay(journal_t *journal, struct buffer_head *bh,
+ enum passtype pass, int off, tid_t expected_tid)
+{
+ return JBD2_FC_REPLAY_STOP;
+}
+
static errcode_t e2fsck_get_journal(e2fsck_t ctx, journal_t **ret_journal)
{
struct process_block_struct pb;
@@ -514,6 +525,10 @@ static errcode_t e2fsck_get_journal(e2fsck_t ctx, journal_t **ret_journal)
journal->j_sb_buffer = bh;
journal->j_superblock = (journal_superblock_t *)bh->b_data;
+ if (ext2fs_has_feature_fast_commit(ctx->fs->super))
+ journal->j_fc_replay_callback = ext4_fc_replay;
+ else
+ journal->j_fc_replay_callback = NULL;
#ifdef USE_INODE_IO
if (j_inode)