^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef _BCACHE_DEBUG_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define _BCACHE_DEBUG_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) struct bio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) struct cached_dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) struct cache_set;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #ifdef CONFIG_BCACHE_DEBUG
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) void bch_btree_verify(struct btree *b);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) void bch_data_verify(struct cached_dev *dc, struct bio *bio);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define expensive_debug_checks(c) ((c)->expensive_debug_checks)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #define key_merging_disabled(c) ((c)->key_merging_disabled)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define bypass_torture_test(d) ((d)->bypass_torture_test)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #else /* DEBUG */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) static inline void bch_btree_verify(struct btree *b) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) static inline void bch_data_verify(struct cached_dev *dc, struct bio *bio) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define expensive_debug_checks(c) 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define key_merging_disabled(c) 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define bypass_torture_test(d) 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #ifdef CONFIG_DEBUG_FS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) void bch_debug_init_cache_set(struct cache_set *c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) static inline void bch_debug_init_cache_set(struct cache_set *c) {}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #endif