xref: /linux/fs/bcachefs/debug.h (revision 8e07e0e3964ca4e23ce7b68e2096fe660a888942)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _BCACHEFS_DEBUG_H
3 #define _BCACHEFS_DEBUG_H
4 
5 #include "bcachefs.h"
6 
7 struct bio;
8 struct btree;
9 struct bch_fs;
10 
11 void __bch2_btree_verify(struct bch_fs *, struct btree *);
12 void bch2_btree_node_ondisk_to_text(struct printbuf *, struct bch_fs *,
13 				    const struct btree *);
14 
15 static 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
22 void bch2_fs_debug_exit(struct bch_fs *);
23 void bch2_fs_debug_init(struct bch_fs *);
24 #else
25 static inline void bch2_fs_debug_exit(struct bch_fs *c) {}
26 static inline void bch2_fs_debug_init(struct bch_fs *c) {}
27 #endif
28 
29 void bch2_debug_exit(void);
30 int bch2_debug_init(void);
31 
32 #endif /* _BCACHEFS_DEBUG_H */
33