tree-checker.h (14e77332e74603efab8347c89d3cda447c3b97c9) | tree-checker.h (27137fac4c0628fc8320bb7f1ce3bb9f84b76a9b) |
---|---|
1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Copyright (C) Qu Wenruo 2017. All rights reserved. 4 */ 5 6#ifndef BTRFS_TREE_CHECKER_H 7#define BTRFS_TREE_CHECKER_H 8 | 1/* SPDX-License-Identifier: GPL-2.0 */ 2/* 3 * Copyright (C) Qu Wenruo 2017. All rights reserved. 4 */ 5 6#ifndef BTRFS_TREE_CHECKER_H 7#define BTRFS_TREE_CHECKER_H 8 |
9#include "ctree.h" 10#include "extent_io.h" | 9#include <uapi/linux/btrfs_tree.h> |
11 | 10 |
11struct extent_buffer; 12struct btrfs_chunk; 13 14/* All the extra info needed to verify the parentness of a tree block. */ 15struct btrfs_tree_parent_check { 16 /* 17 * The owner check against the tree block. 18 * 19 * Can be 0 to skip the owner check. 20 */ 21 u64 owner_root; 22 23 /* 24 * Expected transid, can be 0 to skip the check, but such skip 25 * should only be utlized for backref walk related code. 26 */ 27 u64 transid; 28 29 /* 30 * The expected first key. 31 * 32 * This check can be skipped if @has_first_key is false, such skip 33 * can happen for case where we don't have the parent node key, 34 * e.g. reading the tree root, doing backref walk. 35 */ 36 struct btrfs_key first_key; 37 bool has_first_key; 38 39 /* The expected level. Should always be set. */ 40 u8 level; 41}; 42 |
|
12/* 13 * Comprehensive leaf checker. 14 * Will check not only the item pointers, but also every possible member 15 * in item data. 16 */ 17int btrfs_check_leaf_full(struct extent_buffer *leaf); 18 19/* 20 * Less strict leaf checker. 21 * Will only check item pointers, not reading item data. 22 */ 23int btrfs_check_leaf_relaxed(struct extent_buffer *leaf); 24int btrfs_check_node(struct extent_buffer *node); 25 26int btrfs_check_chunk_valid(struct extent_buffer *leaf, 27 struct btrfs_chunk *chunk, u64 logical); 28int btrfs_check_eb_owner(const struct extent_buffer *eb, u64 root_owner); 29 30#endif | 43/* 44 * Comprehensive leaf checker. 45 * Will check not only the item pointers, but also every possible member 46 * in item data. 47 */ 48int btrfs_check_leaf_full(struct extent_buffer *leaf); 49 50/* 51 * Less strict leaf checker. 52 * Will only check item pointers, not reading item data. 53 */ 54int btrfs_check_leaf_relaxed(struct extent_buffer *leaf); 55int btrfs_check_node(struct extent_buffer *node); 56 57int btrfs_check_chunk_valid(struct extent_buffer *leaf, 58 struct btrfs_chunk *chunk, u64 logical); 59int btrfs_check_eb_owner(const struct extent_buffer *eb, u64 root_owner); 60 61#endif |