bcachefs: Don't touch journal_buf->data->seq in journal_res_get

This is a small optimization, reducing the number of cachelines we touch
in the fast path - and it's also necessary for the next patch that
increases JOURNAL_BUF_NR.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet
2025-01-23 13:06:35 -05:00
parent 199a3578ed
commit 2e853fdbc7

View File

@@ -364,7 +364,10 @@ static inline int journal_res_get_fast(struct journal *j,
res->ref = true;
res->offset = old.cur_entry_offset;
res->seq = le64_to_cpu(j->buf[old.idx].data->seq);
res->seq = journal_cur_seq(j);
res->seq -= (res->seq - old.idx) & JOURNAL_BUF_MASK;
EBUG_ON(res->seq != le64_to_cpu(j->buf[old.idx].data->seq));
return 1;
}