summaryrefslogtreecommitdiff
path: root/libbcachefs/journal.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-02-09 18:34:08 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-02-09 18:36:24 -0500
commita104f0407b7f5de54972389ef10e11dd8c525a96 (patch)
tree07c993aeedb4bfe4a52d6725a689a6b018d2b483 /libbcachefs/journal.h
parentabe1c3bc8e116879a258bff2316cfb0586f15fec (diff)
Update bcachefs sources to ea93c26e98 fixup! bcachefs: We can handle missing btree roots for all alloc btrees
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'libbcachefs/journal.h')
-rw-r--r--libbcachefs/journal.h23
1 files changed, 2 insertions, 21 deletions
diff --git a/libbcachefs/journal.h b/libbcachefs/journal.h
index ee37f90a..024cea9f 100644
--- a/libbcachefs/journal.h
+++ b/libbcachefs/journal.h
@@ -110,7 +110,6 @@
*/
#include <linux/hash.h>
-#include <linux/prefetch.h>
#include "journal_types.h"
@@ -305,26 +304,15 @@ static inline int journal_res_get_fast(struct journal *j,
{
union journal_res_state old, new;
u64 v = atomic64_read(&j->reservations.counter);
- unsigned u64s, offset;
do {
old.v = new.v = v;
/*
- * Round up the end of the journal reservation to the next
- * cacheline boundary:
- */
- u64s = res->u64s;
- offset = sizeof(struct jset) / sizeof(u64) +
- new.cur_entry_offset + u64s;
- u64s += ((offset - 1) & ((SMP_CACHE_BYTES / sizeof(u64)) - 1)) + 1;
-
-
- /*
* Check if there is still room in the current journal
* entry:
*/
- if (new.cur_entry_offset + u64s > j->cur_entry_u64s)
+ if (new.cur_entry_offset + res->u64s > j->cur_entry_u64s)
return 0;
EBUG_ON(!journal_state_count(new, new.idx));
@@ -332,7 +320,7 @@ static inline int journal_res_get_fast(struct journal *j,
if ((flags & JOURNAL_WATERMARK_MASK) < j->watermark)
return 0;
- new.cur_entry_offset += u64s;
+ new.cur_entry_offset += res->u64s;
journal_state_inc(&new);
/*
@@ -349,15 +337,8 @@ static inline int journal_res_get_fast(struct journal *j,
res->ref = true;
res->idx = old.idx;
- res->u64s = u64s;
res->offset = old.cur_entry_offset;
res->seq = le64_to_cpu(j->buf[old.idx].data->seq);
-
- offset = res->offset;
- while (offset < res->offset + res->u64s) {
- prefetchw(vstruct_idx(j->buf[res->idx].data, offset));
- offset += SMP_CACHE_BYTES / sizeof(u64);
- }
return 1;
}