blob: 1f63c195d2476ece1b0c50b6acdddd1a1d92ba8b [file] [log] [blame]
Kent Overstreetcafe5632013-03-23 16:11:31 -07001#ifndef _BCACHE_DEBUG_H
2#define _BCACHE_DEBUG_H
3
Kent Overstreetdc9d98d2013-12-17 23:47:33 -08004struct bio;
5struct cached_dev;
6struct cache_set;
Kent Overstreetcafe5632013-03-23 16:11:31 -07007
8#ifdef CONFIG_BCACHE_DEBUG
9
Kent Overstreet78b77bf2013-12-17 22:49:08 -080010void bch_btree_verify(struct btree *);
Kent Overstreet220bb382013-09-10 19:02:45 -070011void bch_data_verify(struct cached_dev *, struct bio *);
Kent Overstreet280481d2013-10-24 16:36:03 -070012
Kent Overstreet280481d2013-10-24 16:36:03 -070013#define expensive_debug_checks(c) ((c)->expensive_debug_checks)
14#define key_merging_disabled(c) ((c)->key_merging_disabled)
Kent Overstreet5ceaaad2013-09-10 14:27:42 -070015#define bypass_torture_test(d) ((d)->bypass_torture_test)
Kent Overstreetcafe5632013-03-23 16:11:31 -070016
17#else /* DEBUG */
18
Kent Overstreet78b77bf2013-12-17 22:49:08 -080019static inline void bch_btree_verify(struct btree *b) {}
Kent Overstreet280481d2013-10-24 16:36:03 -070020static inline void bch_data_verify(struct cached_dev *dc, struct bio *bio) {}
Kent Overstreet280481d2013-10-24 16:36:03 -070021
Kent Overstreet280481d2013-10-24 16:36:03 -070022#define expensive_debug_checks(c) 0
23#define key_merging_disabled(c) 0
Kent Overstreet5ceaaad2013-09-10 14:27:42 -070024#define bypass_torture_test(d) 0
Kent Overstreetcafe5632013-03-23 16:11:31 -070025
26#endif
27
Kent Overstreetcafe5632013-03-23 16:11:31 -070028#ifdef CONFIG_DEBUG_FS
29void bch_debug_init_cache_set(struct cache_set *);
30#else
31static inline void bch_debug_init_cache_set(struct cache_set *c) {}
32#endif
33
34#endif