bcachefs: Rework btree iterator lifetimes
authorKent Overstreet <kent.overstreet@gmail.com>
Fri, 27 Sep 2019 02:21:39 +0000 (22:21 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:28 +0000 (17:08 -0400)
commit64bc00115335450c4178fea04c5b664cf73a9729
tree3e491d56806bfa5037273a1dd4fb631a2c8177c7
parenta7199432c3cbcd42141cfd5c047bf8828c2390d8
bcachefs: Rework btree iterator lifetimes

The btree_trans struct needs to memoize/cache btree iterators, so that
on transaction restart we don't have to completely redo btree lookups,
and so that we can do them all at once in the correct order when the
transaction had to restart to avoid a deadlock.

This switches the btree iterator lookups to work based on iterator
position, instead of trying to match them up based on the stack trace.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_types.h
fs/bcachefs/btree_update.h
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/buckets.c
fs/bcachefs/fs-io.c
fs/bcachefs/io.c
fs/bcachefs/reflink.c
fs/bcachefs/str_hash.h