18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci#ifndef _BCACHE_DEBUG_H
38c2ecf20Sopenharmony_ci#define _BCACHE_DEBUG_H
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_cistruct bio;
68c2ecf20Sopenharmony_cistruct cached_dev;
78c2ecf20Sopenharmony_cistruct cache_set;
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifdef CONFIG_BCACHE_DEBUG
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_civoid bch_btree_verify(struct btree *b);
128c2ecf20Sopenharmony_civoid bch_data_verify(struct cached_dev *dc, struct bio *bio);
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#define expensive_debug_checks(c)	((c)->expensive_debug_checks)
158c2ecf20Sopenharmony_ci#define key_merging_disabled(c)		((c)->key_merging_disabled)
168c2ecf20Sopenharmony_ci#define bypass_torture_test(d)		((d)->bypass_torture_test)
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#else /* DEBUG */
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_cistatic inline void bch_btree_verify(struct btree *b) {}
218c2ecf20Sopenharmony_cistatic inline void bch_data_verify(struct cached_dev *dc, struct bio *bio) {}
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#define expensive_debug_checks(c)	0
248c2ecf20Sopenharmony_ci#define key_merging_disabled(c)		0
258c2ecf20Sopenharmony_ci#define bypass_torture_test(d)		0
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#endif
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#ifdef CONFIG_DEBUG_FS
308c2ecf20Sopenharmony_civoid bch_debug_init_cache_set(struct cache_set *c);
318c2ecf20Sopenharmony_ci#else
328c2ecf20Sopenharmony_cistatic inline void bch_debug_init_cache_set(struct cache_set *c) {}
338c2ecf20Sopenharmony_ci#endif
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#endif
36