summaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_types.h
diff options
context:
space:
mode:
authorBrian Foster <bfoster@redhat.com>2023-07-19 08:53:05 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:10:08 -0400
commiteabb10dc9561525661d4fda229134a6f8716e007 (patch)
tree99bedcabba20f58f0e2f4f1bdc37afadb74dc15d /fs/bcachefs/btree_types.h
parent78623ee0d0d72c497967be41277f022c0052631c (diff)
bcachefs: support btree updates of prejournaled keys
Introduce support for prejournaled key updates. This allows a transaction to commit an update for a key that already exists (and is pinned) in the journal. This is required for btree write buffer updates as the current scheme of journaling both on write buffer insertion and write buffer (slow path) flush is unsafe in certain crash recovery scenarios. Create a small trans update wrapper to pass along the seq where the key resides into the btree_insert_entry. From there, trans commit passes the seq into the btree insert path where it is used to manage the journal pin for the associated btree leaf. Note that this patch only introduces the underlying mechanism and otherwise includes no functional changes. Signed-off-by: Brian Foster <bfoster@redhat.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_types.h')
-rw-r--r--fs/bcachefs/btree_types.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h
index 937f9c2b63ed..9bfaa15d5ad4 100644
--- a/fs/bcachefs/btree_types.h
+++ b/fs/bcachefs/btree_types.h
@@ -380,6 +380,7 @@ struct btree_insert_entry {
u8 old_btree_u64s;
struct bkey_i *k;
struct btree_path *path;
+ u64 seq;
/* key being overwritten: */
struct bkey old_k;
const struct bch_val *old_v;