btrfs: move struct btrfs_tree_parent_check out of disk-io.h
authorChristoph Hellwig <hch@lst.de>
Tue, 15 Nov 2022 09:44:04 +0000 (10:44 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 5 Dec 2022 17:00:57 +0000 (18:00 +0100)
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: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: David Sterba <dsterba@suse.com>
[ use tree-checker.h for the structure ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/backref.c
fs/btrfs/disk-io.h
fs/btrfs/print-tree.c
fs/btrfs/qgroup.c
fs/btrfs/tree-checker.h
fs/btrfs/tree-mod-log.c
fs/btrfs/volumes.h

index 55c072ba674711e071b65ecc60112d8ee34b0260..21c92c74bf71a4742a69902d8037531fb7b86b31 100644 (file)
@@ -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
index 03fe4154ffb838246b3b18ea4134759db5c0bcc3..363935cfc084464bcb3bb7386b5eea54e511f307 100644 (file)
@@ -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);
index 1469aa55ad482918a9f81e302cc0ac9d744f82fd..b93c962133048174bd5c9e867f971da8da994c3a 100644 (file)
@@ -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;
index e0522c6c0d67a9508e21a752178da562f703859f..5c636e00d77da395a3dbccecadb17b4a02d3879a 100644 (file)
@@ -28,6 +28,7 @@
 #include "accessors.h"
 #include "extent-tree.h"
 #include "root-tree.h"
+#include "tree-checker.h"
 
 /*
  * Helpers to access qgroup reservation
index ece497e265589f0be686f30017dff4e4aa21cc08..bfb5efa4e01f9bed647f936e809752021e67ce64 100644 (file)
@@ -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.
index 779ad44d285f84cecd802e2d67b6acb4a9f21799..146a6b19893349718831cfa2689311826cf495e6 100644 (file)
@@ -5,6 +5,7 @@
 #include "disk-io.h"
 #include "fs.h"
 #include "accessors.h"
+#include "tree-checker.h"
 
 struct tree_mod_root {
        u64 logical;
index 2c90e50c460a30635045d8d62e2495fa61d32e08..ab551471c1f8a31760aa038c12a892f189831ef2 100644 (file)
@@ -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)