aboutsummaryrefslogtreecommitdiff
path: root/fs/bcachefs/btree_types.h
diff options
context:
space:
mode:
authorGravatar Kent Overstreet <kent.overstreet@gmail.com> 2022-07-17 19:35:38 -0400
committerGravatar Kent Overstreet <kent.overstreet@linux.dev> 2023-10-22 17:09:36 -0400
commite941ae7d3afc68127adef917a2b779dabe83fdfe (patch)
tree577edab610a98f574dbfc9cc9bf2622959affe95 /fs/bcachefs/btree_types.h
parentbcachefs: Convert alloc code to for_each_btree_key_commit() (diff)
downloadlinux-e941ae7d3afc68127adef917a2b779dabe83fdfe.tar.gz
linux-e941ae7d3afc68127adef917a2b779dabe83fdfe.tar.bz2
linux-e941ae7d3afc68127adef917a2b779dabe83fdfe.zip
bcachefs: Add a counter for btree_trans restarts
This will help us improve nested transactions - we need to add assertions that whenever an inner transaction handles a restart, it still returns -EINTR to the outer transaction. This also adds nested_lockrestart_do() and nested_commit_do() which use the new counters to correctly return -EINTR when the transaction was restarted. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/btree_types.h')
-rw-r--r--fs/bcachefs/btree_types.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/bcachefs/btree_types.h b/fs/bcachefs/btree_types.h
index 64f4bc8913e8..0650a3558182 100644
--- a/fs/bcachefs/btree_types.h
+++ b/fs/bcachefs/btree_types.h
@@ -410,6 +410,9 @@ struct btree_trans {
bool memory_allocation_failure:1;
bool journal_transaction_names:1;
bool journal_replay_not_finished:1;
+ u32 restart_count;
+ unsigned long last_restarted_ip;
+
/*
* For when bch2_trans_update notices we'll be splitting a compressed
* extent: