Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 2 | #ifndef _BCACHE_DEBUG_H |
| 3 | #define _BCACHE_DEBUG_H |
| 4 | |
Kent Overstreet | dc9d98d | 2013-12-17 23:47:33 -0800 | [diff] [blame] | 5 | struct bio; |
| 6 | struct cached_dev; |
| 7 | struct cache_set; |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 8 | |
| 9 | #ifdef CONFIG_BCACHE_DEBUG |
| 10 | |
Coly Li | fc2d598 | 2018-08-11 13:19:46 +0800 | [diff] [blame] | 11 | void bch_btree_verify(struct btree *b); |
| 12 | void bch_data_verify(struct cached_dev *dc, struct bio *bio); |
Kent Overstreet | 280481d | 2013-10-24 16:36:03 -0700 | [diff] [blame] | 13 | |
Kent Overstreet | 280481d | 2013-10-24 16:36:03 -0700 | [diff] [blame] | 14 | #define expensive_debug_checks(c) ((c)->expensive_debug_checks) |
| 15 | #define key_merging_disabled(c) ((c)->key_merging_disabled) |
Kent Overstreet | 5ceaaad | 2013-09-10 14:27:42 -0700 | [diff] [blame] | 16 | #define bypass_torture_test(d) ((d)->bypass_torture_test) |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 17 | |
| 18 | #else /* DEBUG */ |
| 19 | |
Kent Overstreet | 78b77bf | 2013-12-17 22:49:08 -0800 | [diff] [blame] | 20 | static inline void bch_btree_verify(struct btree *b) {} |
Kent Overstreet | 280481d | 2013-10-24 16:36:03 -0700 | [diff] [blame] | 21 | 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] | 22 | |
Kent Overstreet | 280481d | 2013-10-24 16:36:03 -0700 | [diff] [blame] | 23 | #define expensive_debug_checks(c) 0 |
| 24 | #define key_merging_disabled(c) 0 |
Kent Overstreet | 5ceaaad | 2013-09-10 14:27:42 -0700 | [diff] [blame] | 25 | #define bypass_torture_test(d) 0 |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 26 | |
| 27 | #endif |
| 28 | |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 29 | #ifdef CONFIG_DEBUG_FS |
Coly Li | fc2d598 | 2018-08-11 13:19:46 +0800 | [diff] [blame] | 30 | void bch_debug_init_cache_set(struct cache_set *c); |
Kent Overstreet | cafe563 | 2013-03-23 16:11:31 -0700 | [diff] [blame] | 31 | #else |
| 32 | static inline void bch_debug_init_cache_set(struct cache_set *c) {} |
| 33 | #endif |
| 34 | |
| 35 | #endif |