summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/bset.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2024-05-08 07:42:10 +0200
committerKent Overstreet <kent.overstreet@linux.dev>2024-05-09 22:23:34 +0200
commitb6fb4269e707bb410e202fb160c8d7a188ef60f8 (patch)
tree6b3fd116eaa3be7cbaa71c4e72078e4ce749b829 /fs/bcachefs/bset.h
parentbcachefs: Move BCACHEFS_STATFS_MAGIC value to UAPI magic.h (diff)
downloadlinux-b6fb4269e707bb410e202fb160c8d7a188ef60f8.tar.xz
linux-b6fb4269e707bb410e202fb160c8d7a188ef60f8.zip
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) {