xref: /openbmc/linux/drivers/md/bcache/debug.h (revision 3eb66e91a25497065c5322b1268cbc3953642227)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2cafe5635SKent Overstreet #ifndef _BCACHE_DEBUG_H
3cafe5635SKent Overstreet #define _BCACHE_DEBUG_H
4cafe5635SKent Overstreet 
5dc9d98d6SKent Overstreet struct bio;
6dc9d98d6SKent Overstreet struct cached_dev;
7dc9d98d6SKent Overstreet struct cache_set;
8cafe5635SKent Overstreet 
9cafe5635SKent Overstreet #ifdef CONFIG_BCACHE_DEBUG
10cafe5635SKent Overstreet 
11*fc2d5988SColy Li void bch_btree_verify(struct btree *b);
12*fc2d5988SColy Li void bch_data_verify(struct cached_dev *dc, struct bio *bio);
13280481d0SKent Overstreet 
14280481d0SKent Overstreet #define expensive_debug_checks(c)	((c)->expensive_debug_checks)
15280481d0SKent Overstreet #define key_merging_disabled(c)		((c)->key_merging_disabled)
165ceaaad7SKent Overstreet #define bypass_torture_test(d)		((d)->bypass_torture_test)
17cafe5635SKent Overstreet 
18cafe5635SKent Overstreet #else /* DEBUG */
19cafe5635SKent Overstreet 
bch_btree_verify(struct btree * b)2078b77bf8SKent Overstreet static inline void bch_btree_verify(struct btree *b) {}
bch_data_verify(struct cached_dev * dc,struct bio * bio)21280481d0SKent Overstreet static inline void bch_data_verify(struct cached_dev *dc, struct bio *bio) {}
22280481d0SKent Overstreet 
23280481d0SKent Overstreet #define expensive_debug_checks(c)	0
24280481d0SKent Overstreet #define key_merging_disabled(c)		0
255ceaaad7SKent Overstreet #define bypass_torture_test(d)		0
26cafe5635SKent Overstreet 
27cafe5635SKent Overstreet #endif
28cafe5635SKent Overstreet 
29cafe5635SKent Overstreet #ifdef CONFIG_DEBUG_FS
30*fc2d5988SColy Li void bch_debug_init_cache_set(struct cache_set *c);
31cafe5635SKent Overstreet #else
bch_debug_init_cache_set(struct cache_set * c)32cafe5635SKent Overstreet static inline void bch_debug_init_cache_set(struct cache_set *c) {}
33cafe5635SKent Overstreet #endif
34cafe5635SKent Overstreet 
35cafe5635SKent Overstreet #endif
36