~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/fs/btrfs/tree-checker.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 <linux/types.h>
 10 #include <uapi/linux/btrfs_tree.h>
 11 
 12 struct extent_buffer;
 13 struct btrfs_chunk;
 14 struct btrfs_key;
 15 
 16 /* All the extra info needed to verify the parentness of a tree block. */
 17 struct btrfs_tree_parent_check {
 18         /*
 19          * The owner check against the tree block.
 20          *
 21          * Can be 0 to skip the owner check.
 22          */
 23         u64 owner_root;
 24 
 25         /*
 26          * Expected transid, can be 0 to skip the check, but such skip
 27          * should only be utilized for backref walk related code.
 28          */
 29         u64 transid;
 30 
 31         /*
 32          * The expected first key.
 33          *
 34          * This check can be skipped if @has_first_key is false, such skip
 35          * can happen for case where we don't have the parent node key,
 36          * e.g. reading the tree root, doing backref walk.
 37          */
 38         struct btrfs_key first_key;
 39         bool has_first_key;
 40 
 41         /* The expected level. Should always be set. */
 42         u8 level;
 43 };
 44 
 45 enum btrfs_tree_block_status {
 46         BTRFS_TREE_BLOCK_CLEAN,
 47         BTRFS_TREE_BLOCK_INVALID_NRITEMS,
 48         BTRFS_TREE_BLOCK_INVALID_PARENT_KEY,
 49         BTRFS_TREE_BLOCK_BAD_KEY_ORDER,
 50         BTRFS_TREE_BLOCK_INVALID_LEVEL,
 51         BTRFS_TREE_BLOCK_INVALID_FREE_SPACE,
 52         BTRFS_TREE_BLOCK_INVALID_OFFSETS,
 53         BTRFS_TREE_BLOCK_INVALID_BLOCKPTR,
 54         BTRFS_TREE_BLOCK_INVALID_ITEM,
 55         BTRFS_TREE_BLOCK_INVALID_OWNER,
 56         BTRFS_TREE_BLOCK_WRITTEN_NOT_SET,
 57 };
 58 
 59 /*
 60  * Exported simply for btrfs-progs which wants to have the
 61  * btrfs_tree_block_status return codes.
 62  */
 63 enum btrfs_tree_block_status __btrfs_check_leaf(struct extent_buffer *leaf);
 64 enum btrfs_tree_block_status __btrfs_check_node(struct extent_buffer *node);
 65 
 66 int btrfs_check_leaf(struct extent_buffer *leaf);
 67 int btrfs_check_node(struct extent_buffer *node);
 68 
 69 int btrfs_check_chunk_valid(struct extent_buffer *leaf,
 70                             struct btrfs_chunk *chunk, u64 logical);
 71 int btrfs_check_eb_owner(const struct extent_buffer *eb, u64 root_owner);
 72 int btrfs_verify_level_key(struct extent_buffer *eb, int level,
 73                            struct btrfs_key *first_key, u64 parent_transid);
 74 
 75 #endif
 76 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php