bcachefs: Move btree node merging to before transaction commit
authorKent Overstreet <kent.overstreet@gmail.com>
Mon, 29 Mar 2021 05:13:31 +0000 (01:13 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:08:58 +0000 (17:08 -0400)
commitb182ff609f2519998a6b4ad853a2fc1d3f0f0af5
tree72601f512236bfd6111e353f552c8d185fee1964
parentecab6be7e5c3e19d25a4ad9d5d97c83e3ac67507
bcachefs: Move btree node merging to before transaction commit

Currently, BTREE_INSERT_NOUNLOCK makes it hard to ensure btree node
merging happens reliably - since btree node merging happens after
transaction commit, we can't drop btree locks and block when starting
the btree update.

This patch moves it to before transaction commit - and failure to do a
merge that we wanted to do just restarts the transaction.

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