diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-07 13:11:44 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 11:47:40 -0500 |
commit | f8fd5871becf3beb7dff84c4608140a8c571c9a9 (patch) | |
tree | 83e1b5fb2918be8a633282c501408233f3906f53 /fs/bcachefs/btree_iter.h | |
parent | 5028b9078ccb02ead012056dcbcc4f27f963b212 (diff) | |
download | linux-f8fd5871becf3beb7dff84c4608140a8c571c9a9.tar.gz linux-f8fd5871becf3beb7dff84c4608140a8c571c9a9.tar.bz2 linux-f8fd5871becf3beb7dff84c4608140a8c571c9a9.zip |
bcachefs: reserve path idx 0 for sentinal
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 | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/btree_iter.h b/fs/bcachefs/btree_iter.h index 5f401056c3ed..5be3c1a2c820 100644 --- a/fs/bcachefs/btree_iter.h +++ b/fs/bcachefs/btree_iter.h @@ -80,7 +80,7 @@ __trans_next_path(struct btree_trans *trans, unsigned idx) _path = __trans_next_path((_trans), (_path)->idx + 1)) #define trans_for_each_path(_trans, _path) \ - trans_for_each_path_from(_trans, _path, 0) + trans_for_each_path_from(_trans, _path, 1) static inline struct btree_path * __trans_next_path_safe(struct btree_trans *trans, unsigned *idx) @@ -103,7 +103,7 @@ __trans_next_path_safe(struct btree_trans *trans, unsigned *idx) _idx++) #define trans_for_each_path_safe(_trans, _path, _idx) \ - trans_for_each_path_safe_from(_trans, _path, _idx, 0) + trans_for_each_path_safe_from(_trans, _path, _idx, 1) static inline struct btree_path *next_btree_path(struct btree_trans *trans, struct btree_path *path) { @@ -155,7 +155,7 @@ __trans_next_path_with_node(struct btree_trans *trans, struct btree *b, } #define trans_for_each_path_with_node(_trans, _b, _path) \ - for (_path = __trans_next_path_with_node((_trans), (_b), 0); \ + for (_path = __trans_next_path_with_node((_trans), (_b), 1); \ (_path); \ _path = __trans_next_path_with_node((_trans), (_b), \ (_path)->idx + 1)) |