bcachefs: Count iterators for reflink_p overwrites correctly
authorKent Overstreet <kent.overstreet@gmail.com>
Sun, 22 Sep 2019 21:48:25 +0000 (17:48 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:27 +0000 (17:08 -0400)
commitfe9cdf61cc7cb791c40d076503d8910fc0727310
tree2dac9fc10d00a3406f91e88a22bd015d23659374
parentfb975d14b7737c4381e539677b2e2b99ca9f8d62
bcachefs: Count iterators for reflink_p overwrites correctly

In order to avoid trying to allocate too many btree iterators,
bch2_extent_atomic_end() needs to count how many iterators are going to
be needed for insertions and overwrites - but we weren't counting the
iterators for deleting a reflink_v when the refcount goes to 0.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/extents.c