mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 07:23:14 +00:00
bcachefs: Unlink not-touched iters on successful transaction commit
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
bf7b87a4a9
commit
4afe700060
@ -1892,6 +1892,7 @@ int bch2_trans_unlock(struct btree_trans *trans)
|
||||
inline void bch2_trans_unlink_iters(struct btree_trans *trans, u64 iters)
|
||||
{
|
||||
iters &= trans->iters_linked;
|
||||
iters &= ~trans->iters_live;
|
||||
|
||||
while (iters) {
|
||||
unsigned idx = __ffs64(iters);
|
||||
@ -1919,9 +1920,10 @@ void __bch2_trans_begin(struct btree_trans *trans)
|
||||
iters_to_unlink |= trans->iters_unlink_on_restart;
|
||||
iters_to_unlink |= trans->iters_unlink_on_commit;
|
||||
|
||||
trans->iters_live = 0;
|
||||
|
||||
bch2_trans_unlink_iters(trans, iters_to_unlink);
|
||||
|
||||
trans->iters_live = 0;
|
||||
trans->iters_touched = 0;
|
||||
trans->iters_unlink_on_restart = 0;
|
||||
trans->iters_unlink_on_commit = 0;
|
||||
|
@ -856,6 +856,10 @@ int bch2_trans_commit(struct btree_trans *trans,
|
||||
BUG_ON(!(trans->flags & BTREE_INSERT_ATOMIC) && ret == -EINTR);
|
||||
|
||||
bch2_trans_unlink_iters(trans, trans->iters_unlink_on_commit);
|
||||
if (!ret) {
|
||||
bch2_trans_unlink_iters(trans, ~trans->iters_touched);
|
||||
trans->iters_touched = 0;
|
||||
}
|
||||
trans->nr_updates = 0;
|
||||
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user