1/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef _BCACHEFS_DEBUG_H
3#define _BCACHEFS_DEBUG_H
4
5#include "bcachefs.h"
6
7struct bio;
8struct btree;
9struct bch_fs;
10
11void __bch2_btree_verify(struct bch_fs *, struct btree *);
12void bch2_btree_node_ondisk_to_text(struct printbuf *, struct bch_fs *,
13				    const struct btree *);
14
15static inline void bch2_btree_verify(struct bch_fs *c, struct btree *b)
16{
17	if (bch2_verify_btree_ondisk)
18		__bch2_btree_verify(c, b);
19}
20
21#ifdef CONFIG_DEBUG_FS
22void bch2_fs_debug_exit(struct bch_fs *);
23void bch2_fs_debug_init(struct bch_fs *);
24#else
25static inline void bch2_fs_debug_exit(struct bch_fs *c) {}
26static inline void bch2_fs_debug_init(struct bch_fs *c) {}
27#endif
28
29void bch2_debug_exit(void);
30int bch2_debug_init(void);
31
32#endif /* _BCACHEFS_DEBUG_H */
33