From 158eecb88ed3100bef01917913a26e9aad152417 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 14 Nov 2020 16:04:30 -0500 Subject: bcachefs: Assorted journal refactoring Improved the way we track various state by adding j->err_seq, which records the first journal sequence number that encountered an error being written, and j->last_empty_seq, which records the most recent journal entry that was completely empty. Also, use the low bits of the journal sequence number to index the corresponding journal_buf. Signed-off-by: Kent Overstreet Signed-off-by: Kent Overstreet --- fs/bcachefs/journal_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs/bcachefs/journal_types.h') diff --git a/fs/bcachefs/journal_types.h b/fs/bcachefs/journal_types.h index 6d0ee8e42da1..22ff7f8081c6 100644 --- a/fs/bcachefs/journal_types.h +++ b/fs/bcachefs/journal_types.h @@ -127,7 +127,6 @@ enum { JOURNAL_STARTED, JOURNAL_RECLAIM_STARTED, JOURNAL_NEED_WRITE, - JOURNAL_NOT_EMPTY, JOURNAL_MAY_GET_UNRESERVED, }; @@ -181,6 +180,8 @@ struct journal { /* seq, last_seq from the most recent journal entry successfully written */ u64 seq_ondisk; u64 last_seq_ondisk; + u64 err_seq; + u64 last_empty_seq; /* * FIFO of journal entries whose btree updates have not yet been -- cgit v1.2.3-58-ga151