summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/btree_key_cache.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-11 05:37:45 +0100
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-01 17:47:43 +0100
commitccb7b08fbbb85e9b0bb2867497d98172a5737ad5 (patch)
tree9cc04e7750d9226ca3160b7837e8e76ae45f111a /fs/bcachefs/btree_key_cache.c
parentbcachefs: kill trans_for_each_path_from() (diff)
downloadlinux-ccb7b08fbbb85e9b0bb2867497d98172a5737ad5.tar.xz
linux-ccb7b08fbbb85e9b0bb2867497d98172a5737ad5.zip
bcachefs: trans_for_each_path() no longer uses path->idx
path->idx is now a code smell: we should be using path_idx_t, since it's stable across btree path reallocation. This is also a bit faster, using the same loop counter vs. fetching path->idx from each path we iterate over. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_key_cache.c')
-rw-r--r--fs/bcachefs/btree_key_cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bcachefs/btree_key_cache.c b/fs/bcachefs/btree_key_cache.c
index 99dc0b1a7fc2..74e52fd28abe 100644
--- a/fs/bcachefs/btree_key_cache.c
+++ b/fs/bcachefs/btree_key_cache.c
@@ -690,8 +690,9 @@ static int btree_key_cache_flush_pos(struct btree_trans *trans,
}
} else {
struct btree_path *path2;
+ unsigned i;
evict:
- trans_for_each_path(trans, path2)
+ trans_for_each_path(trans, path2, i)
if (path2 != path)
__bch2_btree_path_unlock(trans, path2);