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: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2023-03-06 02:34:59 -05:00
parent 26bab33b69
commit a345b0f393
4 changed files with 8 additions and 8 deletions

View File

@ -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);

View File

@ -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 *);

View File

@ -1150,7 +1150,7 @@ wait_on_io:
}
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));

View File

@ -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 */