From 24de63dacbffbfa069b44a1da1750eb5382275e7 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sun, 10 Dec 2023 16:48:22 -0500 Subject: bcachefs: Improve trans->extra_journal_entries Instead of using a darray, we now allocate journal entries for the transaction commit path with our normal bump allocator - with an inlined fastpath, and using btree_transaction_stats to remember how much to initially allocate so as to avoid transaction restarts. This is prep work for converting write buffer updates to use this mechanism. Signed-off-by: Kent Overstreet --- fs/bcachefs/btree_types.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'fs/bcachefs/btree_types.h') diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h index 78de9569ff14..40e5a004e5c1 100644 --- a/fs/bcachefs/btree_types.h +++ b/fs/bcachefs/btree_types.h @@ -410,7 +410,9 @@ struct btree_trans { * extent: */ unsigned extra_journal_res; - unsigned nr_max_paths; + u8 nr_max_paths; + u16 journal_entries_u64s; + u16 journal_entries_size; unsigned long paths_allocated[BITS_TO_LONGS(BTREE_ITER_MAX)]; @@ -426,7 +428,7 @@ struct btree_trans { /* update path: */ struct btree_trans_commit_hook *hooks; - darray_u64 extra_journal_entries; + struct jset_entry *journal_entries; struct journal_entry_pin *journal_pin; struct journal_res journal_res; -- cgit v1.2.3