David Sterba | 9888c34 | 2018-04-03 19:16:55 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Qu Wenruo | 557ea5d | 2017-10-09 01:51:02 +0000 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) Qu Wenruo 2017. All rights reserved. |
Qu Wenruo | 557ea5d | 2017-10-09 01:51:02 +0000 | [diff] [blame] | 4 | */ |
| 5 | |
David Sterba | 9888c34 | 2018-04-03 19:16:55 +0200 | [diff] [blame] | 6 | #ifndef BTRFS_TREE_CHECKER_H |
| 7 | #define BTRFS_TREE_CHECKER_H |
Qu Wenruo | 557ea5d | 2017-10-09 01:51:02 +0000 | [diff] [blame] | 8 | |
| 9 | #include "ctree.h" |
| 10 | #include "extent_io.h" |
| 11 | |
Qu Wenruo | 69fc6cb | 2017-11-08 08:54:24 +0800 | [diff] [blame] | 12 | /* |
| 13 | * Comprehensive leaf checker. |
| 14 | * Will check not only the item pointers, but also every possible member |
| 15 | * in item data. |
| 16 | */ |
David Sterba | 1c4360e | 2019-03-20 16:23:29 +0100 | [diff] [blame] | 17 | int btrfs_check_leaf_full(struct extent_buffer *leaf); |
Qu Wenruo | 69fc6cb | 2017-11-08 08:54:24 +0800 | [diff] [blame] | 18 | |
| 19 | /* |
| 20 | * Less strict leaf checker. |
| 21 | * Will only check item pointers, not reading item data. |
| 22 | */ |
David Sterba | cfdaad5 | 2019-03-20 16:24:18 +0100 | [diff] [blame] | 23 | int btrfs_check_leaf_relaxed(struct extent_buffer *leaf); |
David Sterba | 813fd1d | 2019-03-20 16:25:00 +0100 | [diff] [blame] | 24 | int btrfs_check_node(struct extent_buffer *node); |
Qu Wenruo | 557ea5d | 2017-10-09 01:51:02 +0000 | [diff] [blame] | 25 | |
David Sterba | ddaf1d5 | 2019-03-20 16:40:48 +0100 | [diff] [blame] | 26 | int btrfs_check_chunk_valid(struct extent_buffer *leaf, |
Qu Wenruo | 82fc28f | 2019-03-20 13:16:42 +0800 | [diff] [blame] | 27 | struct btrfs_chunk *chunk, u64 logical); |
| 28 | |
Qu Wenruo | 557ea5d | 2017-10-09 01:51:02 +0000 | [diff] [blame] | 29 | #endif |