Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 1 | #ifndef _BCACHE_DEBUG_H |
| 2 | #define _BCACHE_DEBUG_H |
| 3 | |
Kent Overstreet | dc9d98d | 2013-12-17 23:47:33 -0800 | [diff] [blame] | 4 | struct bio; |
| 5 | struct cached_dev; |
| 6 | struct cache_set; |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 7 | |
| 8 | #ifdef CONFIG_BCACHE_DEBUG |
| 9 | |
Kent Overstreet | 78b77bf | 2013-12-17 22:49:08 -0800 | [diff] [blame] | 10 | void bch_btree_verify(struct btree *); |
Kent Overstreet | 220bb38 | 2013-09-10 19:02:45 -0700 | [diff] [blame] | 11 | void bch_data_verify(struct cached_dev *, struct bio *); |
Kent Overstreet | 280481d | 2013-10-24 16:36:03 -0700 | [diff] [blame] | 12 | |
Kent Overstreet | 280481d | 2013-10-24 16:36:03 -0700 | [diff] [blame] | 13 | #define expensive_debug_checks(c) ((c)->expensive_debug_checks) |
| 14 | #define key_merging_disabled(c) ((c)->key_merging_disabled) |
Kent Overstreet | 5ceaaad | 2013-09-10 14:27:42 -0700 | [diff] [blame] | 15 | #define bypass_torture_test(d) ((d)->bypass_torture_test) |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 16 | |
| 17 | #else /* DEBUG */ |
| 18 | |
Kent Overstreet | 78b77bf | 2013-12-17 22:49:08 -0800 | [diff] [blame] | 19 | static inline void bch_btree_verify(struct btree *b) {} |
Kent Overstreet | 280481d | 2013-10-24 16:36:03 -0700 | [diff] [blame] | 20 | static inline void bch_data_verify(struct cached_dev *dc, struct bio *bio) {} |
Kent Overstreet | 280481d | 2013-10-24 16:36:03 -0700 | [diff] [blame] | 21 | |
Kent Overstreet | 280481d | 2013-10-24 16:36:03 -0700 | [diff] [blame] | 22 | #define expensive_debug_checks(c) 0 |
| 23 | #define key_merging_disabled(c) 0 |
Kent Overstreet | 5ceaaad | 2013-09-10 14:27:42 -0700 | [diff] [blame] | 24 | #define bypass_torture_test(d) 0 |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 25 | |
| 26 | #endif |
| 27 | |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 28 | #ifdef CONFIG_DEBUG_FS |
| 29 | void bch_debug_init_cache_set(struct cache_set *); |
| 30 | #else |
| 31 | static inline void bch_debug_init_cache_set(struct cache_set *c) {} |
| 32 | #endif |
| 33 | |
| 34 | #endif |