Commit 27137fac authored by Christoph Hellwig's avatar Christoph Hellwig Committed by David Sterba
Browse files

btrfs: move struct btrfs_tree_parent_check out of disk-io.h



Move struct btrfs_tree_parent_check out of disk-io.h so that volumes.h
an various .c files don't have to include disk-io.h just for it.

Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
[ use tree-checker.h for the structure ]
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 7a315072
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include "accessors.h"
#include "extent-tree.h"
#include "relocation.h"
#include "tree-checker.h"

/* Just arbitrary numbers so we can be sure one of these happened. */
#define BACKREF_FOUND_SHARED     6
+1 −29
Original line number Diff line number Diff line
@@ -25,37 +25,9 @@ static inline u64 btrfs_sb_offset(int mirror)
	return BTRFS_SUPER_INFO_OFFSET;
}

/* All the extra info needed to verify the parentness of a tree block. */
struct btrfs_tree_parent_check {
	/*
	 * The owner check against the tree block.
	 *
	 * Can be 0 to skip the owner check.
	 */
	u64 owner_root;

	/*
	 * Expected transid, can be 0 to skip the check, but such skip
	 * should only be utlized for backref walk related code.
	 */
	u64 transid;

	/*
	 * The expected first key.
	 *
	 * This check can be skipped if @has_first_key is false, such skip
	 * can happen for case where we don't have the parent node key,
	 * e.g. reading the tree root, doing backref walk.
	 */
	struct btrfs_key first_key;
	bool has_first_key;

	/* The expected level. Should always be set. */
	u8 level;
};

struct btrfs_device;
struct btrfs_fs_devices;
struct btrfs_tree_parent_check;

void btrfs_check_leaked_roots(struct btrfs_fs_info *fs_info);
void btrfs_init_fs_info(struct btrfs_fs_info *fs_info);
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@
#include "disk-io.h"
#include "print-tree.h"
#include "accessors.h"
#include "tree-checker.h"

struct root_name_map {
	u64 id;
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include "accessors.h"
#include "extent-tree.h"
#include "root-tree.h"
#include "tree-checker.h"

/*
 * Helpers to access qgroup reservation
+33 −2
Original line number Diff line number Diff line
@@ -6,8 +6,39 @@
#ifndef BTRFS_TREE_CHECKER_H
#define BTRFS_TREE_CHECKER_H

#include "ctree.h"
#include "extent_io.h"
#include <uapi/linux/btrfs_tree.h>

struct extent_buffer;
struct btrfs_chunk;

/* All the extra info needed to verify the parentness of a tree block. */
struct btrfs_tree_parent_check {
	/*
	 * The owner check against the tree block.
	 *
	 * Can be 0 to skip the owner check.
	 */
	u64 owner_root;

	/*
	 * Expected transid, can be 0 to skip the check, but such skip
	 * should only be utlized for backref walk related code.
	 */
	u64 transid;

	/*
	 * The expected first key.
	 *
	 * This check can be skipped if @has_first_key is false, such skip
	 * can happen for case where we don't have the parent node key,
	 * e.g. reading the tree root, doing backref walk.
	 */
	struct btrfs_key first_key;
	bool has_first_key;

	/* The expected level. Should always be set. */
	u8 level;
};

/*
 * Comprehensive leaf checker.
Loading