summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/journal.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-02-28 19:17:27 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:26 -0400
commit30ef633a0b46e06860f46bf7df0f5a313e6e1a19 (patch)
tree8b6ffa6870ea55dad13072acc60ac4b0ef08c99d /fs/bcachefs/journal.h
parentbcachefs: Journal seq now incremented at entry open, not close (diff)
downloadlinux-30ef633a0b46e06860f46bf7df0f5a313e6e1a19.tar.gz
linux-30ef633a0b46e06860f46bf7df0f5a313e6e1a19.zip
bcachefs: Refactor journal code to not use unwritten_idx
It makes the code more readable if we work off of sequence numbers, instead of direct indexes into the array of journal buffers. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/journal.h')
-rw-r--r--fs/bcachefs/journal.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/journal.h b/fs/bcachefs/journal.h
index 6c7a38ad2195..409d32b784d2 100644
--- a/fs/bcachefs/journal.h
+++ b/fs/bcachefs/journal.h
@@ -141,6 +141,11 @@ static inline u64 journal_cur_seq(struct journal *j)
return j->pin.back - 1;
}
+static inline u64 journal_last_unwritten_seq(struct journal *j)
+{
+ return j->seq_ondisk + 1;
+}
+
static inline int journal_state_count(union journal_res_state s, int idx)
{
switch (idx) {