#include <linux/sched.h>
#include <linux/stacktrace.h>
#include "messages.h"
#include "ctree.h"
#include "disk-io.h"
#include "locking.h"
#include "delayed-ref.h"
#include "ref-verify.h"
#include "fs.h"
#include "accessors.h"
struct root_entry { … };
struct ref_entry { … };
#define MAX_TRACE …
struct ref_action { … };
struct block_entry { … };
static struct block_entry *insert_block_entry(struct rb_root *root,
struct block_entry *be)
{ … }
static struct block_entry *lookup_block_entry(struct rb_root *root, u64 bytenr)
{ … }
static struct root_entry *insert_root_entry(struct rb_root *root,
struct root_entry *re)
{ … }
static int comp_refs(struct ref_entry *ref1, struct ref_entry *ref2)
{ … }
static struct ref_entry *insert_ref_entry(struct rb_root *root,
struct ref_entry *ref)
{ … }
static struct root_entry *lookup_root_entry(struct rb_root *root, u64 objectid)
{ … }
#ifdef CONFIG_STACKTRACE
static void __save_stack_trace(struct ref_action *ra)
{ … }
static void __print_stack_trace(struct btrfs_fs_info *fs_info,
struct ref_action *ra)
{ … }
#else
static inline void __save_stack_trace(struct ref_action *ra)
{
}
static inline void __print_stack_trace(struct btrfs_fs_info *fs_info,
struct ref_action *ra)
{
btrfs_err(fs_info, " ref-verify: no stacktrace support");
}
#endif
static void free_block_entry(struct block_entry *be)
{ … }
static struct block_entry *add_block_entry(struct btrfs_fs_info *fs_info,
u64 bytenr, u64 len,
u64 root_objectid)
{ … }
static int add_tree_block(struct btrfs_fs_info *fs_info, u64 ref_root,
u64 parent, u64 bytenr, int level)
{ … }
static int add_shared_data_ref(struct btrfs_fs_info *fs_info,
u64 parent, u32 num_refs, u64 bytenr,
u64 num_bytes)
{ … }
static int add_extent_data_ref(struct btrfs_fs_info *fs_info,
struct extent_buffer *leaf,
struct btrfs_extent_data_ref *dref,
u64 bytenr, u64 num_bytes)
{ … }
static int process_extent_item(struct btrfs_fs_info *fs_info,
struct btrfs_path *path, struct btrfs_key *key,
int slot, int *tree_block_level)
{ … }
static int process_leaf(struct btrfs_root *root,
struct btrfs_path *path, u64 *bytenr, u64 *num_bytes,
int *tree_block_level)
{ … }
static int walk_down_tree(struct btrfs_root *root, struct btrfs_path *path,
int level, u64 *bytenr, u64 *num_bytes,
int *tree_block_level)
{ … }
static int walk_up_tree(struct btrfs_path *path, int *level)
{ … }
static void dump_ref_action(struct btrfs_fs_info *fs_info,
struct ref_action *ra)
{ … }
static void dump_block_entry(struct btrfs_fs_info *fs_info,
struct block_entry *be)
{ … }
int btrfs_ref_tree_mod(struct btrfs_fs_info *fs_info,
struct btrfs_ref *generic_ref)
{ … }
void btrfs_free_ref_cache(struct btrfs_fs_info *fs_info)
{ … }
void btrfs_free_ref_tree_range(struct btrfs_fs_info *fs_info, u64 start,
u64 len)
{ … }
int btrfs_build_ref_tree(struct btrfs_fs_info *fs_info)
{ … }