blob: fb3d4dff4b26ea7ad5e088d1e67e65ebe1992903 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Kent Overstreetcafe5632013-03-23 16:11:31 -07002#ifndef _BCACHE_DEBUG_H
3#define _BCACHE_DEBUG_H
4
Kent Overstreetdc9d98d2013-12-17 23:47:33 -08005struct bio;
6struct cached_dev;
7struct cache_set;
Kent Overstreetcafe5632013-03-23 16:11:31 -07008
9#ifdef CONFIG_BCACHE_DEBUG
10
Coly Lifc2d5982018-08-11 13:19:46 +080011void bch_btree_verify(struct btree *b);
12void bch_data_verify(struct cached_dev *dc, struct bio *bio);
Kent Overstreet280481d2013-10-24 16:36:03 -070013
Kent Overstreet280481d2013-10-24 16:36:03 -070014#define expensive_debug_checks(c) ((c)->expensive_debug_checks)
15#define key_merging_disabled(c) ((c)->key_merging_disabled)
Kent Overstreet5ceaaad2013-09-10 14:27:42 -070016#define bypass_torture_test(d) ((d)->bypass_torture_test)
Kent Overstreetcafe5632013-03-23 16:11:31 -070017
18#else /* DEBUG */
19
Kent Overstreet78b77bf2013-12-17 22:49:08 -080020static inline void bch_btree_verify(struct btree *b) {}
Kent Overstreet280481d2013-10-24 16:36:03 -070021static inline void bch_data_verify(struct cached_dev *dc, struct bio *bio) {}
Kent Overstreet280481d2013-10-24 16:36:03 -070022
Kent Overstreet280481d2013-10-24 16:36:03 -070023#define expensive_debug_checks(c) 0
24#define key_merging_disabled(c) 0
Kent Overstreet5ceaaad2013-09-10 14:27:42 -070025#define bypass_torture_test(d) 0
Kent Overstreetcafe5632013-03-23 16:11:31 -070026
27#endif
28
Kent Overstreetcafe5632013-03-23 16:11:31 -070029#ifdef CONFIG_DEBUG_FS
Coly Lifc2d5982018-08-11 13:19:46 +080030void bch_debug_init_cache_set(struct cache_set *c);
Kent Overstreetcafe5632013-03-23 16:11:31 -070031#else
32static inline void bch_debug_init_cache_set(struct cache_set *c) {}
33#endif
34
35#endif