summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/btree_update.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_update.h
parent78623ee0d0d72c497967be41277f022c0052631c (diff)
downloadlinux-stable-eabb10dc9561525661d4fda229134a6f8716e007.tar.gz
linux-stable-eabb10dc9561525661d4fda229134a6f8716e007.tar.bz2
linux-stable-eabb10dc9561525661d4fda229134a6f8716e007.zip
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_update.h')
-rw-r--r--fs/bcachefs/btree_update.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_update.h b/fs/bcachefs/btree_update.h
index f794c9d108b8..256da97f721c 100644
--- a/fs/bcachefs/btree_update.h
+++ b/fs/bcachefs/btree_update.h
@@ -111,6 +111,8 @@ int bch2_bkey_get_empty_slot(struct btree_trans *, struct btree_iter *,
int __must_check bch2_trans_update(struct btree_trans *, struct btree_iter *,
struct bkey_i *, enum btree_update_flags);
+int __must_check bch2_trans_update_seq(struct btree_trans *, u64, struct btree_iter *,
+ struct bkey_i *, enum btree_update_flags);
int __must_check bch2_trans_update_buffered(struct btree_trans *,
enum btree_id, struct bkey_i *);