diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-11 05:57:50 +0100 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 17:47:43 +0100 |
commit | b0b67378225d66a3e1900c188b27586f48c6b119 (patch) | |
tree | 0c05da3d91cd3d8b8b98ff3c19196d8864b375e0 /fs/bcachefs/btree_iter.h | |
parent | bcachefs: trans_for_each_path() no longer uses path->idx (diff) | |
download | linux-b0b67378225d66a3e1900c188b27586f48c6b119.tar.xz linux-b0b67378225d66a3e1900c188b27586f48c6b119.zip |
bcachefs: trans_for_each_path_with_node() no longer uses path->idx
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_iter.h')
-rw-r--r-- | fs/bcachefs/btree_iter.h | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/bcachefs/btree_iter.h b/fs/bcachefs/btree_iter.h index a75d0e7d122a..eb9aa3930ca2 100644 --- a/fs/bcachefs/btree_iter.h +++ b/fs/bcachefs/btree_iter.h @@ -151,22 +151,21 @@ static inline bool __path_has_node(const struct btree_path *path, static inline struct btree_path * __trans_next_path_with_node(struct btree_trans *trans, struct btree *b, - unsigned idx) + unsigned *idx) { - struct btree_path *path = __trans_next_path(trans, &idx); + struct btree_path *path; - while ((path = __trans_next_path(trans, &idx)) && + while ((path = __trans_next_path(trans, idx)) && !__path_has_node(path, b)) - idx++; + (*idx)++; return path; } -#define trans_for_each_path_with_node(_trans, _b, _path) \ - for (_path = __trans_next_path_with_node((_trans), (_b), 1); \ - (_path); \ - _path = __trans_next_path_with_node((_trans), (_b), \ - (_path)->idx + 1)) +#define trans_for_each_path_with_node(_trans, _b, _path, _iter) \ + for (_iter = 1; \ + (_path = __trans_next_path_with_node((_trans), (_b), &_iter));\ + _iter++) btree_path_idx_t __bch2_btree_path_make_mut(struct btree_trans *, btree_path_idx_t, bool, unsigned long); |