summaryrefslogtreecommitdiff
path: root/fs/bcachefs/journal.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-03-01 03:17:27 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:26 +0300
commit30ef633a0b46e06860f46bf7df0f5a313e6e1a19 (patch)
tree8b6ffa6870ea55dad13072acc60ac4b0ef08c99d /fs/bcachefs/journal.h
parentf0a3a2ccabc5ae1e2c7d588a6a4f77d216b1d4cf (diff)
downloadlinux-30ef633a0b46e06860f46bf7df0f5a313e6e1a19.tar.xz
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) {