Commit a345b0f3 authored by Kent Overstreet's avatar Kent Overstreet

bcachefs: bch2_btree_node_to_text() const correctness

This is for the Rust interface - Rust cares more about const than C
does.
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 26bab33b
......@@ -1533,9 +1533,9 @@ struct bkey_s_c bch2_btree_node_iter_peek_unpack(struct btree_node_iter *iter,
/* Mergesort */
void bch2_btree_keys_stats(struct btree *b, struct bset_stats *stats)
void bch2_btree_keys_stats(const struct btree *b, struct bset_stats *stats)
{
struct bset_tree *t;
const struct bset_tree *t;
for_each_bset(b, t) {
enum bset_aux_tree_type type = bset_aux_tree_type(t);
......
......@@ -213,7 +213,7 @@ static inline size_t btree_aux_data_u64s(const struct btree *b)
_k != btree_bkey_last(_b, _t); \
_k = bkey_p_next(_k))
static inline bool bset_has_ro_aux_tree(struct bset_tree *t)
static inline bool bset_has_ro_aux_tree(const struct bset_tree *t)
{
return bset_aux_tree_type(t) == BSET_RO_AUX_TREE;
}
......@@ -504,7 +504,7 @@ struct bset_stats {
size_t failed;
};
void bch2_btree_keys_stats(struct btree *, struct bset_stats *);
void bch2_btree_keys_stats(const struct btree *, struct bset_stats *);
void bch2_bfloat_to_text(struct printbuf *, struct btree *,
struct bkey_packed *);
......
......@@ -1150,7 +1150,7 @@ void bch2_btree_node_evict(struct btree_trans *trans, const struct bkey_i *k)
}
void bch2_btree_node_to_text(struct printbuf *out, struct bch_fs *c,
struct btree *b)
const struct btree *b)
{
const struct bkey_format *f = &b->format;
struct bset_stats stats;
......@@ -1195,7 +1195,7 @@ void bch2_btree_node_to_text(struct printbuf *out, struct bch_fs *c,
stats.failed);
}
void bch2_btree_cache_to_text(struct printbuf *out, struct bch_fs *c)
void bch2_btree_cache_to_text(struct printbuf *out, const struct bch_fs *c)
{
prt_printf(out, "nr nodes:\t\t%u\n", c->btree_cache.used);
prt_printf(out, "nr dirty:\t\t%u\n", atomic_read(&c->btree_cache.dirty));
......
......@@ -100,7 +100,7 @@ static inline unsigned btree_blocks(struct bch_fs *c)
#define btree_node_root(_c, _b) ((_c)->btree_roots[(_b)->c.btree_id].b)
void bch2_btree_node_to_text(struct printbuf *, struct bch_fs *,
struct btree *);
void bch2_btree_cache_to_text(struct printbuf *, struct bch_fs *);
const struct btree *);
void bch2_btree_cache_to_text(struct printbuf *, const struct bch_fs *);
#endif /* _BCACHEFS_BTREE_CACHE_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment