#include <linux/types.h>
#include <linux/stddef.h>
#include <linux/error-injection.h>
#include "messages.h"
#include "ctree.h"
#include "tree-checker.h"
#include "compression.h"
#include "volumes.h"
#include "misc.h"
#include "fs.h"
#include "accessors.h"
#include "file-item.h"
#include "inode-item.h"
#include "dir-item.h"
#include "extent-tree.h"
__printf(3, 4)
__cold
static void generic_err(const struct extent_buffer *eb, int slot,
const char *fmt, ...)
{ … }
__printf(3, 4)
__cold
static void file_extent_err(const struct extent_buffer *eb, int slot,
const char *fmt, ...)
{ … }
#define CHECK_FE_ALIGNED(leaf, slot, fi, name, alignment) …
static u64 file_extent_end(struct extent_buffer *leaf,
struct btrfs_key *key,
struct btrfs_file_extent_item *extent)
{ … }
__printf(3, 4)
__cold
static void dir_item_err(const struct extent_buffer *eb, int slot,
const char *fmt, ...)
{ … }
static bool check_prev_ino(struct extent_buffer *leaf,
struct btrfs_key *key, int slot,
struct btrfs_key *prev_key)
{ … }
static int check_extent_data_item(struct extent_buffer *leaf,
struct btrfs_key *key, int slot,
struct btrfs_key *prev_key)
{ … }
static int check_csum_item(struct extent_buffer *leaf, struct btrfs_key *key,
int slot, struct btrfs_key *prev_key)
{ … }
#define inode_item_err(eb, slot, fmt, ...) …
static int check_inode_key(struct extent_buffer *leaf, struct btrfs_key *key,
int slot)
{ … }
static int check_root_key(struct extent_buffer *leaf, struct btrfs_key *key,
int slot)
{ … }
static int check_dir_item(struct extent_buffer *leaf,
struct btrfs_key *key, struct btrfs_key *prev_key,
int slot)
{ … }
__printf(3, 4)
__cold
static void block_group_err(const struct extent_buffer *eb, int slot,
const char *fmt, ...)
{ … }
static int check_block_group_item(struct extent_buffer *leaf,
struct btrfs_key *key, int slot)
{ … }
__printf(4, 5)
__cold
static void chunk_err(const struct extent_buffer *leaf,
const struct btrfs_chunk *chunk, u64 logical,
const char *fmt, ...)
{ … }
int btrfs_check_chunk_valid(struct extent_buffer *leaf,
struct btrfs_chunk *chunk, u64 logical)
{ … }
static int check_leaf_chunk_item(struct extent_buffer *leaf,
struct btrfs_chunk *chunk,
struct btrfs_key *key, int slot)
{ … }
__printf(3, 4)
__cold
static void dev_item_err(const struct extent_buffer *eb, int slot,
const char *fmt, ...)
{ … }
static int check_dev_item(struct extent_buffer *leaf,
struct btrfs_key *key, int slot)
{ … }
static int check_inode_item(struct extent_buffer *leaf,
struct btrfs_key *key, int slot)
{ … }
static int check_root_item(struct extent_buffer *leaf, struct btrfs_key *key,
int slot)
{ … }
__printf(3,4)
__cold
static void extent_err(const struct extent_buffer *eb, int slot,
const char *fmt, ...)
{ … }
static bool is_valid_dref_root(u64 rootid)
{ … }
static int check_extent_item(struct extent_buffer *leaf,
struct btrfs_key *key, int slot,
struct btrfs_key *prev_key)
{ … }
static int check_simple_keyed_refs(struct extent_buffer *leaf,
struct btrfs_key *key, int slot)
{ … }
static int check_extent_data_ref(struct extent_buffer *leaf,
struct btrfs_key *key, int slot)
{ … }
#define inode_ref_err(eb, slot, fmt, args...) …
static int check_inode_ref(struct extent_buffer *leaf,
struct btrfs_key *key, struct btrfs_key *prev_key,
int slot)
{ … }
static int check_raid_stripe_extent(const struct extent_buffer *leaf,
const struct btrfs_key *key, int slot)
{ … }
static enum btrfs_tree_block_status check_leaf_item(struct extent_buffer *leaf,
struct btrfs_key *key,
int slot,
struct btrfs_key *prev_key)
{ … }
enum btrfs_tree_block_status __btrfs_check_leaf(struct extent_buffer *leaf)
{ … }
int btrfs_check_leaf(struct extent_buffer *leaf)
{ … }
ALLOW_ERROR_INJECTION(…);
enum btrfs_tree_block_status __btrfs_check_node(struct extent_buffer *node)
{ … }
int btrfs_check_node(struct extent_buffer *node)
{ … }
ALLOW_ERROR_INJECTION(…);
int btrfs_check_eb_owner(const struct extent_buffer *eb, u64 root_owner)
{ … }
int btrfs_verify_level_key(struct extent_buffer *eb, int level,
struct btrfs_key *first_key, u64 parent_transid)
{ … }