]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: Don't trace should_be_locked unless changing
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 11 Jun 2025 02:32:14 +0000 (22:32 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 12 Jun 2025 03:25:41 +0000 (23:25 -0400)
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_locking.h

index 9adca77e258083d105d46e8306dea7ca355e4472..f2173a3316f4a088e2cffd4e07ff855df0f00fc0 100644 (file)
@@ -417,8 +417,10 @@ static inline void btree_path_set_should_be_locked(struct btree_trans *trans, st
        EBUG_ON(!btree_node_locked(path, path->level));
        EBUG_ON(path->uptodate);
 
-       path->should_be_locked = true;
-       trace_btree_path_should_be_locked(trans, path);
+       if (!path->should_be_locked) {
+               path->should_be_locked = true;
+               trace_btree_path_should_be_locked(trans, path);
+       }
 }
 
 static inline void __btree_path_set_level_up(struct btree_trans *trans,