bcachefs: Move extent_handle_overwrites() to bch2_trans_update()
authorKent Overstreet <kent.overstreet@gmail.com>
Wed, 2 Jun 2021 04:18:34 +0000 (00:18 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:06 +0000 (17:09 -0400)
commit8e6bbc4181c9eb1bc8dcb0a96522447c6b6ad76e
tree272d302979217f8a7bd6cab484f2b3def734f2cf
parentb1d87f527d7e6eb89395d4a0218b7e4e3974ff1b
bcachefs: Move extent_handle_overwrites() to bch2_trans_update()

This lifts handling of overlapping extents out of __bch2_trans_commit()
and moves it to where we first do the update - which means that
BTREE_ITER_WITH_UPDATES can now work correctly in extents mode.

Also, this patch reworks how extent triggers work: previously, on
partial extent overwrite we would pass this information to the trigger,
telling it what part of the extent was being overwritten. But, this
approach has had too many subtle corner cases - now, we only mark whole
extents, meaning on partial extent overwrite we unmark the old extent
and mark the new extent.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_update_leaf.c
fs/bcachefs/buckets.c