bcachefs: Add a counter for btree_trans restarts
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 17 Jul 2022 23:35:38 +0000 (19:35 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:36 +0000 (17:09 -0400)
commite941ae7d3afc68127adef917a2b779dabe83fdfe
tree577edab610a98f574dbfc9cc9bf2622959affe95
parent445d184af25abd70575539f7d7b2c8e25b8c49c8
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>
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_types.h
fs/bcachefs/btree_update.h