xref: /linux/fs/bcachefs/debug.h (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
11c6fdbd8SKent Overstreet /* SPDX-License-Identifier: GPL-2.0 */
21c6fdbd8SKent Overstreet #ifndef _BCACHEFS_DEBUG_H
31c6fdbd8SKent Overstreet #define _BCACHEFS_DEBUG_H
41c6fdbd8SKent Overstreet 
51c6fdbd8SKent Overstreet #include "bcachefs.h"
61c6fdbd8SKent Overstreet 
71c6fdbd8SKent Overstreet struct bio;
81c6fdbd8SKent Overstreet struct btree;
91c6fdbd8SKent Overstreet struct bch_fs;
101c6fdbd8SKent Overstreet 
111c6fdbd8SKent Overstreet void __bch2_btree_verify(struct bch_fs *, struct btree *);
12*b65499b7SKent Overstreet void bch2_btree_node_ondisk_to_text(struct printbuf *, struct bch_fs *,
13*b65499b7SKent Overstreet 				    const struct btree *);
141c6fdbd8SKent Overstreet 
bch2_btree_verify(struct bch_fs * c,struct btree * b)151c6fdbd8SKent Overstreet static inline void bch2_btree_verify(struct bch_fs *c, struct btree *b)
161c6fdbd8SKent Overstreet {
1729364f34SKent Overstreet 	if (bch2_verify_btree_ondisk)
181c6fdbd8SKent Overstreet 		__bch2_btree_verify(c, b);
191c6fdbd8SKent Overstreet }
201c6fdbd8SKent Overstreet 
211c6fdbd8SKent Overstreet #ifdef CONFIG_DEBUG_FS
221c6fdbd8SKent Overstreet void bch2_fs_debug_exit(struct bch_fs *);
231c6fdbd8SKent Overstreet void bch2_fs_debug_init(struct bch_fs *);
241c6fdbd8SKent Overstreet #else
bch2_fs_debug_exit(struct bch_fs * c)251c6fdbd8SKent Overstreet static inline void bch2_fs_debug_exit(struct bch_fs *c) {}
bch2_fs_debug_init(struct bch_fs * c)261c6fdbd8SKent Overstreet static inline void bch2_fs_debug_init(struct bch_fs *c) {}
271c6fdbd8SKent Overstreet #endif
281c6fdbd8SKent Overstreet 
291c6fdbd8SKent Overstreet void bch2_debug_exit(void);
301c6fdbd8SKent Overstreet int bch2_debug_init(void);
311c6fdbd8SKent Overstreet 
321c6fdbd8SKent Overstreet #endif /* _BCACHEFS_DEBUG_H */
33