summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarshad Shirwadkar <harshadshirwadkar@gmail.com>2020-10-15 13:37:58 -0700
committerTheodore Ts'o <tytso@mit.edu>2020-10-21 23:22:37 -0400
commit5b849b5f96b47d82b5a432d8b91a8ad260e1de46 (patch)
treece8db17eb198b300b591bf088463781f690efcac /include
parentaa75f4d3daaeb1389b9cce9d6b84401eaf228d4e (diff)
downloadlinux-5b849b5f96b47d82b5a432d8b91a8ad260e1de46.tar.bz2
jbd2: fast commit recovery path
This patch adds fast commit recovery support in JBD2. Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Link: https://lore.kernel.org/r/20201015203802.3597742-7-harshadshirwadkar@gmail.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'include')
-rw-r--r--include/linux/jbd2.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index a009d9b9c620..fb3d71ad6eea 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -751,6 +751,11 @@ jbd2_time_diff(unsigned long start, unsigned long end)
#define JBD2_NR_BATCH 64
+enum passtype {PASS_SCAN, PASS_REVOKE, PASS_REPLAY};
+
+#define JBD2_FC_REPLAY_STOP 0
+#define JBD2_FC_REPLAY_CONTINUE 1
+
/**
* struct journal_s - The journal_s type is the concrete type associated with
* journal_t.
@@ -1248,6 +1253,21 @@ struct journal_s
*/
void (*j_fc_cleanup_callback)(struct journal_s *journal, int);
+ /*
+ * @j_fc_replay_callback:
+ *
+ * File-system specific function that performs replay of a fast
+ * commit. JBD2 calls this function for each fast commit block found in
+ * the journal. This function should return JBD2_FC_REPLAY_CONTINUE
+ * to indicate that the block was processed correctly and more fast
+ * commit replay should continue. Return value of JBD2_FC_REPLAY_STOP
+ * indicates the end of replay (no more blocks remaining). A negative
+ * return value indicates error.
+ */
+ int (*j_fc_replay_callback)(struct journal_s *journal,
+ struct buffer_head *bh,
+ enum passtype pass, int off,
+ tid_t expected_commit_id);
};
#define jbd2_might_wait_for_commit(j) \