summaryrefslogtreecommitdiff
path: root/libbcachefs/btree_iter.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-03-05 17:06:24 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2022-03-05 17:06:24 -0500
commitb797b087a9c47f95a70b4ed38c080af006280e16 (patch)
tree16545ec258666d62250c2c0e4b9ff324fc171882 /libbcachefs/btree_iter.c
parent4568914cfbe371c65db7c9fb903f659478904782 (diff)
Update bcachefs sources to 259ff91605 bcachefs: Don't keep around btree_paths unnecessarily
Diffstat (limited to 'libbcachefs/btree_iter.c')
-rw-r--r--libbcachefs/btree_iter.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbcachefs/btree_iter.c b/libbcachefs/btree_iter.c
index c0357ee9..8186ee7e 100644
--- a/libbcachefs/btree_iter.c
+++ b/libbcachefs/btree_iter.c
@@ -3017,6 +3017,14 @@ void bch2_trans_begin(struct btree_trans *trans)
path->should_be_locked = false;
/*
+ * If the transaction wasn't restarted, we're presuming to be
+ * doing something new: dont keep iterators excpt the ones that
+ * are in use - except for the subvolumes btree:
+ */
+ if (!trans->restarted && path->btree_id != BTREE_ID_subvolumes)
+ path->preserve = false;
+
+ /*
* XXX: we probably shouldn't be doing this if the transaction
* was restarted, but currently we still overflow transaction
* iterators if we do that