debug.h 783 B

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