summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/backref.c1
-rw-r--r--fs/btrfs/disk-io.h30
-rw-r--r--fs/btrfs/print-tree.c1
-rw-r--r--fs/btrfs/qgroup.c1
-rw-r--r--fs/btrfs/tree-checker.h35
-rw-r--r--fs/btrfs/tree-mod-log.c1
-rw-r--r--fs/btrfs/volumes.h2
7 files changed, 39 insertions, 32 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c
index 55c072ba6747..21c92c74bf71 100644
--- a/fs/btrfs/backref.c
+++ b/fs/btrfs/backref.c
@@ -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
diff --git a/fs/btrfs/disk-io.h b/fs/btrfs/disk-io.h
index 03fe4154ffb8..363935cfc084 100644
--- a/fs/btrfs/disk-io.h
+++ b/fs/btrfs/disk-io.h
@@ -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);
diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c
index 1469aa55ad48..b93c96213304 100644
--- a/fs/btrfs/print-tree.c
+++ b/fs/btrfs/print-tree.c
@@ -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;
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index e0522c6c0d67..5c636e00d77d 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -28,6 +28,7 @@
#include "accessors.h"
#include "extent-tree.h"
#include "root-tree.h"
+#include "tree-checker.h"
/*
* Helpers to access qgroup reservation
diff --git a/fs/btrfs/tree-checker.h b/fs/btrfs/tree-checker.h
index ece497e26558..bfb5efa4e01f 100644
--- a/fs/btrfs/tree-checker.h
+++ b/fs/btrfs/tree-checker.h
@@ -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.
diff --git a/fs/btrfs/tree-mod-log.c b/fs/btrfs/tree-mod-log.c
index 779ad44d285f..146a6b198933 100644
--- a/fs/btrfs/tree-mod-log.c
+++ b/fs/btrfs/tree-mod-log.c
@@ -5,6 +5,7 @@
#include "disk-io.h"
#include "fs.h"
#include "accessors.h"
+#include "tree-checker.h"
struct tree_mod_root {
u64 logical;
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
index 2c90e50c460a..ab551471c1f8 100644
--- a/fs/btrfs/volumes.h
+++ b/fs/btrfs/volumes.h
@@ -11,7 +11,7 @@
#include <linux/btrfs.h>
#include "async-thread.h"
#include "messages.h"
-#include "disk-io.h"
+#include "tree-checker.h"
#include "rcu-string.h"
#define BTRFS_MAX_DATA_CHUNK_SIZE (10ULL * SZ_1G)