xref: /openbmc/linux/drivers/md/bcache/debug.h (revision 4f3db074)
1 #ifndef _BCACHE_DEBUG_H
2 #define _BCACHE_DEBUG_H
3 
4 struct bio;
5 struct cached_dev;
6 struct cache_set;
7 
8 #ifdef CONFIG_BCACHE_DEBUG
9 
10 void bch_btree_verify(struct btree *);
11 void bch_data_verify(struct cached_dev *, struct bio *);
12 
13 #define expensive_debug_checks(c)	((c)->expensive_debug_checks)
14 #define key_merging_disabled(c)		((c)->key_merging_disabled)
15 #define bypass_torture_test(d)		((d)->bypass_torture_test)
16 
17 #else /* DEBUG */
18 
19 static inline void bch_btree_verify(struct btree *b) {}
20 static inline void bch_data_verify(struct cached_dev *dc, struct bio *bio) {}
21 
22 #define expensive_debug_checks(c)	0
23 #define key_merging_disabled(c)		0
24 #define bypass_torture_test(d)		0
25 
26 #endif
27 
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
35