From: Kent Overstreet Date: Sat, 17 Feb 2024 04:50:05 +0000 (-0500) Subject: bcachefs: Drop redundant btree_path_downgrade()s X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=29e11f96993dd10210bfda0e09f43f307afc3639;p=linux.git bcachefs: Drop redundant btree_path_downgrade()s If a path doesn't have any active references, we shouldn't downgrade it; it'll either be reused, possibly with intent refs again, or dropped at bch2_trans_begin() time. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/btree_locking.c b/fs/bcachefs/btree_locking.c index 6843974423381..b9b151e693ed6 100644 --- a/fs/bcachefs/btree_locking.c +++ b/fs/bcachefs/btree_locking.c @@ -747,7 +747,8 @@ void bch2_trans_downgrade(struct btree_trans *trans) return; trans_for_each_path(trans, path, i) - bch2_btree_path_downgrade(trans, path); + if (path->ref) + bch2_btree_path_downgrade(trans, path); } int bch2_trans_relock(struct btree_trans *trans)