summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bset.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-05-08 01:42:10 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-09 16:23:34 -0400
commitb6fb4269e707bb410e202fb160c8d7a188ef60f8 (patch)
tree6b3fd116eaa3be7cbaa71c4e72078e4ce749b829 /fs/bcachefs/bset.h
parente2f48c48090dea172c0c571101041de64634dae5 (diff)
bcachefs: for_each_bset() declares loop iter
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bset.h')
-rw-r--r--fs/bcachefs/bset.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/bset.h b/fs/bcachefs/bset.h
index 120a79fd456b..5c6c7a14fa0f 100644
--- a/fs/bcachefs/bset.h
+++ b/fs/bcachefs/bset.h
@@ -206,7 +206,10 @@ static inline size_t btree_aux_data_u64s(const struct btree *b)
}
#define for_each_bset(_b, _t) \
- for (_t = (_b)->set; _t < (_b)->set + (_b)->nsets; _t++)
+ for (struct bset_tree *_t = (_b)->set; _t < (_b)->set + (_b)->nsets; _t++)
+
+#define for_each_bset_c(_b, _t) \
+ for (const struct bset_tree *_t = (_b)->set; _t < (_b)->set + (_b)->nsets; _t++)
#define bset_tree_for_each_key(_b, _t, _k) \
for (_k = btree_bkey_first(_b, _t); \
@@ -294,7 +297,6 @@ static inline struct bset_tree *
bch2_bkey_to_bset_inlined(struct btree *b, struct bkey_packed *k)
{
unsigned offset = __btree_node_key_to_offset(b, k);
- struct bset_tree *t;
for_each_bset(b, t)
if (offset <= t->end_offset) {