From 21aa6777b20e6a389c7c017731d36cd66d5fbd2e Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 28 Aug 2023 22:12:13 +0200 Subject: [PATCH] btrfs-progs: clean up includes, using include-what-you-use Signed-off-by: David Sterba --- btrfs-corrupt-block.c | 3 +++ btrfs-find-root.c | 4 +++- btrfs-map-logical.c | 4 +++- btrfs-select-super.c | 2 +- btrfs.c | 1 + check/clear-cache.c | 8 +++++++- check/main.c | 8 +++++--- check/mode-common.c | 2 ++ check/mode-common.h | 2 ++ check/mode-lowmem.c | 4 +++- check/qgroup-verify.c | 3 ++- check/repair.c | 3 +++ check/repair.h | 7 ++++++- cmds/balance.c | 3 +-- cmds/device.c | 3 +-- cmds/filesystem-du.c | 4 +++- cmds/filesystem-usage.c | 5 ++++- cmds/filesystem-usage.h | 2 +- cmds/filesystem.c | 2 -- cmds/inspect-dump-super.c | 6 +++++- cmds/inspect-dump-tree.c | 7 +++---- cmds/inspect-tree-stats.c | 7 ++++--- cmds/inspect.c | 3 +++ cmds/property.c | 4 +--- cmds/qgroup.c | 7 +++++++ cmds/quota.c | 2 ++ cmds/receive.c | 1 - cmds/reflink.c | 3 ++- cmds/replace.c | 1 - cmds/rescue-chunk-recover.c | 6 +++++- cmds/rescue-super-recover.c | 2 ++ cmds/rescue.c | 6 ++++-- cmds/restore.c | 3 +++ cmds/scrub.c | 2 -- cmds/send.c | 1 + cmds/subvolume-list.c | 7 +++++++ cmds/subvolume.c | 2 ++ common/cpu-utils.c | 1 - common/device-scan.c | 3 ++- common/device-scan.h | 1 + common/device-utils.c | 3 ++- common/device-utils.h | 6 ++++-- common/extent-tree-utils.c | 4 ++++ common/extent-tree-utils.h | 8 ++++++++ common/filesystem-utils.c | 2 ++ common/format-output.c | 3 ++- common/fsfeatures.c | 2 +- common/help.c | 1 + common/inject-error.c | 2 ++ common/inject-error.h | 2 -- common/messages.c | 1 + common/open-utils.h | 1 + common/parse-utils.c | 1 + common/parse-utils.h | 1 - common/rbtree-utils.h | 3 ++- common/send-stream.c | 4 +++- common/send-stream.h | 2 ++ common/send-utils.c | 3 +++ common/send-utils.h | 1 - common/sysfs-utils.h | 2 ++ common/utils.c | 9 +++++++-- common/utils.h | 10 +++------- convert/common.c | 5 ++++- convert/main.c | 3 +++ convert/source-fs.c | 2 ++ convert/source-fs.h | 5 ++--- crypto/hash.h | 1 + image/common.c | 26 +++++++++++++++++++++++++- image/common.h | 2 ++ image/image-create.c | 17 ++++++++++++++++- image/image-restore.c | 20 +++++++++++++++++++- image/main.c | 19 +------------------ image/sanitize.c | 3 +++ kernel-lib/list_sort.c | 2 ++ kernel-lib/list_sort.h | 2 -- kernel-lib/raid56.c | 9 +++++---- kernel-lib/raid56.h | 2 ++ kernel-lib/rbtree.c | 5 +++++ kernel-lib/rbtree.h | 1 + kernel-shared/accessors.c | 4 +++- kernel-shared/accessors.h | 6 ++++++ kernel-shared/async-thread.c | 3 ++- kernel-shared/async-thread.h | 2 ++ kernel-shared/backref.c | 10 +++++++++- kernel-shared/backref.h | 14 ++++++++++++-- kernel-shared/ctree.c | 4 ++-- kernel-shared/ctree.h | 13 +++++++------ kernel-shared/delayed-ref.c | 4 ++++ kernel-shared/delayed-ref.h | 7 +++++++ kernel-shared/dir-item.c | 11 ++++++++++- kernel-shared/disk-io.c | 30 +++++++++++++++++++++++++----- kernel-shared/disk-io.h | 11 ++++++++++- kernel-shared/extent-io-tree.c | 6 ++++-- kernel-shared/extent-io-tree.h | 5 ++++- kernel-shared/extent-tree.c | 20 +++++++++++++++++--- kernel-shared/extent_io.c | 15 +++++++++------ kernel-shared/extent_io.h | 5 ++--- kernel-shared/file-item.c | 8 ++++---- kernel-shared/file-item.h | 8 ++++++++ kernel-shared/file.c | 15 +++++++++++---- kernel-shared/free-space-cache.c | 13 ++++++++++--- kernel-shared/free-space-cache.h | 9 +++++++-- kernel-shared/free-space-tree.c | 11 ++++++++--- kernel-shared/free-space-tree.h | 7 +++++++ kernel-shared/inode-item.c | 11 ++++++++++- kernel-shared/inode.c | 9 +++++++-- kernel-shared/locking.c | 2 ++ kernel-shared/locking.h | 4 ++++ kernel-shared/messages.c | 3 ++- kernel-shared/messages.h | 3 +-- kernel-shared/print-tree.c | 16 +++++++++++----- kernel-shared/print-tree.h | 9 +++++++++ kernel-shared/root-tree.c | 9 +++++++-- kernel-shared/transaction.c | 7 +++++++ kernel-shared/transaction.h | 9 ++++++++- kernel-shared/tree-checker.c | 9 +++++++-- kernel-shared/tree-checker.h | 5 +++-- kernel-shared/ulist.c | 3 ++- kernel-shared/ulist.h | 4 +++- kernel-shared/uuid-tree.c | 15 ++++++++++----- kernel-shared/volumes.c | 14 ++++++++++---- kernel-shared/volumes.h | 9 ++++++++- kernel-shared/zoned.c | 13 ++++++++++++- kernel-shared/zoned.h | 6 ++++++ mkfs/common.c | 1 - mkfs/common.h | 2 +- mkfs/main.c | 3 +++ mkfs/rootdir.c | 4 ++-- tune/change-csum.c | 7 ++++++- tune/change-metadata-uuid.c | 2 ++ tune/change-uuid.c | 3 ++- tune/convert-bgt.c | 3 +++ tune/main.c | 5 ++--- tune/seeding.c | 2 ++ 134 files changed, 591 insertions(+), 182 deletions(-) diff --git a/btrfs-corrupt-block.c b/btrfs-corrupt-block.c index 432dc859..12459733 100644 --- a/btrfs-corrupt-block.c +++ b/btrfs-corrupt-block.c @@ -23,6 +23,9 @@ #include #include #include +#include +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/volumes.h" #include "kernel-shared/disk-io.h" diff --git a/btrfs-find-root.c b/btrfs-find-root.c index 32d32429..f0f0079e 100644 --- a/btrfs-find-root.c +++ b/btrfs-find-root.c @@ -21,13 +21,15 @@ #include #include #include +#include +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/tree-checker.h" #include "common/box.h" -#include "common/utils.h" #include "common/extent-cache.h" #include "common/help.h" #include "common/messages.h" diff --git a/btrfs-map-logical.c b/btrfs-map-logical.c index 2a6c6785..2984e645 100644 --- a/btrfs-map-logical.c +++ b/btrfs-map-logical.c @@ -25,12 +25,14 @@ #include #include #include "kernel-lib/sizes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/volumes.h" #include "kernel-shared/disk-io.h" #include "common/internal.h" -#include "common/utils.h" +#include "common/messages.h" #include "common/help.h" #include "common/extent-cache.h" #include "common/extent-tree-utils.h" diff --git a/btrfs-select-super.c b/btrfs-select-super.c index efdaf76e..1d260f07 100644 --- a/btrfs-select-super.c +++ b/btrfs-select-super.c @@ -21,10 +21,10 @@ #include #include #include +#include #include "kernel-shared/ctree.h" #include "kernel-shared/volumes.h" #include "kernel-shared/disk-io.h" -#include "common/utils.h" #include "common/help.h" #include "common/open-utils.h" #include "common/messages.h" diff --git a/btrfs.c b/btrfs.c index 6e8df74d..751f193e 100644 --- a/btrfs.c +++ b/btrfs.c @@ -15,6 +15,7 @@ */ #include "kerncompat.h" +#include #include #include #include diff --git a/check/clear-cache.c b/check/clear-cache.c index 3d69a4f7..d83d9b2f 100644 --- a/check/clear-cache.c +++ b/check/clear-cache.c @@ -15,6 +15,13 @@ */ #include "kerncompat.h" +#include +#include +#include +#include "kernel-lib/rbtree.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent-io-tree.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/ctree.h" #include "kernel-shared/free-space-cache.h" @@ -24,7 +31,6 @@ #include "kernel-shared/file-item.h" #include "common/internal.h" #include "common/messages.h" -#include "check/common.h" #include "check/repair.h" #include "check/mode-common.h" #include "check/clear-cache.h" diff --git a/check/main.c b/check/main.c index 64ed4b4a..5e4e51af 100644 --- a/check/main.c +++ b/check/main.c @@ -27,20 +27,22 @@ #include #include #include +#include #include #include "kernel-lib/list.h" #include "kernel-lib/rbtree.h" #include "kernel-lib/rbtree_types.h" #include "kernel-lib/bitops.h" -#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent-io-tree.h" +#include "kernel-shared/locking.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/ctree.h" #include "kernel-shared/volumes.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/print-tree.h" #include "kernel-shared/transaction.h" -#include "kernel-shared/free-space-cache.h" -#include "kernel-shared/free-space-tree.h" #include "kernel-shared/backref.h" #include "kernel-shared/ulist.h" #include "kernel-shared/file-item.h" diff --git a/check/mode-common.c b/check/mode-common.c index 07ee5385..7afd9ed9 100644 --- a/check/mode-common.c +++ b/check/mode-common.c @@ -21,6 +21,8 @@ #include #include #include "kernel-lib/rbtree.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent-io-tree.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/ctree.h" #include "kernel-shared/transaction.h" diff --git a/check/mode-common.h b/check/mode-common.h index 9ad545d9..894bbbb8 100644 --- a/check/mode-common.h +++ b/check/mode-common.h @@ -25,11 +25,13 @@ #include #include #include "kernel-lib/list.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "common/messages.h" struct btrfs_trans_handle; struct extent_buffer; +struct task_ctx; extern struct task_ctx g_task_ctx; diff --git a/check/mode-lowmem.c b/check/mode-lowmem.c index fb8e7bc5..c3d2fec1 100644 --- a/check/mode-lowmem.c +++ b/check/mode-lowmem.c @@ -20,8 +20,10 @@ #include #include #include -#include #include "kernel-lib/rbtree.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent-io-tree.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/ulist.h" #include "kernel-shared/ctree.h" diff --git a/check/qgroup-verify.c b/check/qgroup-verify.c index 02704d97..66feef88 100644 --- a/check/qgroup-verify.c +++ b/check/qgroup-verify.c @@ -25,6 +25,8 @@ #include "kernel-lib/list.h" #include "kernel-lib/rbtree.h" #include "kernel-lib/rbtree_types.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/ulist.h" @@ -46,7 +48,6 @@ void qgroup_set_item_count_ptr(u64 *item_count_ptr) /*#define QGROUP_VERIFY_DEBUG*/ static unsigned long tot_extents_scanned = 0; -struct qgroup_count; static struct qgroup_count *find_count(u64 qgroupid); struct qgroup_info { diff --git a/check/repair.c b/check/repair.c index e01d0a3d..9656241f 100644 --- a/check/repair.c +++ b/check/repair.c @@ -16,6 +16,7 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" #include #include #include @@ -23,6 +24,8 @@ #include #include "kernel-lib/list.h" #include "kernel-lib/rbtree.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent-io-tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/transaction.h" #include "kernel-shared/extent_io.h" diff --git a/check/repair.h b/check/repair.h index 72f47abf..4d59ca1d 100644 --- a/check/repair.h +++ b/check/repair.h @@ -20,11 +20,16 @@ #define __BTRFS_REPAIR_H__ #include "kerncompat.h" -#include "kernel-shared/ctree.h" +#include "kernel-shared/tree-checker.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/extent-cache.h" struct btrfs_trans_handle; +struct btrfs_fs_info; +struct btrfs_path; +struct btrfs_root; struct extent_io_tree; +struct extent_buffer; /* Repair mode */ extern int opt_check_repair; diff --git a/cmds/balance.c b/cmds/balance.c index c7ce620f..c48133ad 100644 --- a/cmds/balance.c +++ b/cmds/balance.c @@ -25,8 +25,7 @@ #include #include #include -#include "kernel-shared/uapi/btrfs.h" -#include "kernel-shared/ctree.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/volumes.h" #include "common/open-utils.h" #include "common/utils.h" diff --git a/cmds/device.c b/cmds/device.c index 94418d43..a4409b48 100644 --- a/cmds/device.c +++ b/cmds/device.c @@ -25,9 +25,8 @@ #include #include #include -#include "kernel-shared/uapi/btrfs.h" -#include "kernel-shared/ctree.h" #include "kernel-shared/zoned.h" +#include "kernel-shared/volumes.h" #include "common/string-table.h" #include "common/utils.h" #include "common/help.h" diff --git a/cmds/filesystem-du.c b/cmds/filesystem-du.c index 33b6d901..4982123d 100644 --- a/cmds/filesystem-du.c +++ b/cmds/filesystem-du.c @@ -28,10 +28,12 @@ #include #include #include +#include +#include #include "kernel-lib/rbtree.h" #include "kernel-lib/rbtree_types.h" #include "kernel-lib/interval_tree_generic.h" -#include "kernel-shared/ctree.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/utils.h" #include "common/open-utils.h" #include "common/units.h" diff --git a/cmds/filesystem-usage.c b/cmds/filesystem-usage.c index f38051a2..8b97f8ae 100644 --- a/cmds/filesystem-usage.c +++ b/cmds/filesystem-usage.c @@ -18,12 +18,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include @@ -32,6 +32,9 @@ #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" +#include "common/defs.h" #include "common/utils.h" #include "common/string-table.h" #include "common/open-utils.h" diff --git a/cmds/filesystem-usage.h b/cmds/filesystem-usage.h index 2c0db9dc..503660e3 100644 --- a/cmds/filesystem-usage.h +++ b/cmds/filesystem-usage.h @@ -20,7 +20,7 @@ #define __CMDS_FI_USAGE_H__ #include "kerncompat.h" -#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/volumes.h" struct device_info { u64 devid; diff --git a/cmds/filesystem.c b/cmds/filesystem.c index 7dad5f6a..46078956 100644 --- a/cmds/filesystem.c +++ b/cmds/filesystem.c @@ -36,7 +36,6 @@ #include "kernel-lib/list.h" #include "kernel-lib/sizes.h" #include "kernel-lib/list_sort.h" -#include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/ctree.h" #include "kernel-shared/compression.h" #include "kernel-shared/volumes.h" @@ -53,7 +52,6 @@ #include "common/device-utils.h" #include "common/open-utils.h" #include "common/parse-utils.h" -#include "common/string-utils.h" #include "common/filesystem-utils.h" #include "common/format-output.h" #include "cmds/commands.h" diff --git a/cmds/inspect-dump-super.c b/cmds/inspect-dump-super.c index 8a42b5a1..225fb5a2 100644 --- a/cmds/inspect-dump-super.c +++ b/cmds/inspect-dump-super.c @@ -15,12 +15,16 @@ */ #include "kerncompat.h" +#include +#include +#include #include #include #include #include #include -#include +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/print-tree.h" diff --git a/cmds/inspect-dump-tree.c b/cmds/inspect-dump-tree.c index ee27e9c4..2bfeb25b 100644 --- a/cmds/inspect-dump-tree.c +++ b/cmds/inspect-dump-tree.c @@ -17,26 +17,25 @@ */ #include "kerncompat.h" -#include #include #include #include -#include #include #include #include #include #include +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/print-tree.h" -#include "kernel-shared/volumes.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/tree-checker.h" #include "common/defs.h" #include "common/extent-cache.h" #include "common/messages.h" -#include "common/utils.h" #include "common/help.h" #include "common/device-scan.h" #include "common/string-utils.h" diff --git a/cmds/inspect-tree-stats.c b/cmds/inspect-tree-stats.c index df2c9ce5..42dab804 100644 --- a/cmds/inspect-tree-stats.c +++ b/cmds/inspect-tree-stats.c @@ -18,19 +18,20 @@ #include "kerncompat.h" #include -#include #include #include -#include #include +#include +#include #include "kernel-lib/rbtree.h" #include "kernel-lib/rbtree_types.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/file-item.h" #include "kernel-shared/tree-checker.h" -#include "common/utils.h" #include "common/help.h" #include "common/messages.h" #include "common/open-utils.h" diff --git a/cmds/inspect.c b/cmds/inspect.c index 8f54dc3f..50f1ddc7 100644 --- a/cmds/inspect.c +++ b/cmds/inspect.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -31,6 +32,8 @@ #include #include "kernel-lib/list.h" #include "kernel-lib/sizes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" diff --git a/cmds/property.c b/cmds/property.c index d7bb7b66..ba8f56a8 100644 --- a/cmds/property.c +++ b/cmds/property.c @@ -20,17 +20,15 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include "libbtrfsutil/btrfsutil.h" #include "kernel-shared/uapi/btrfs.h" -#include "kernel-shared/ctree.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/defs.h" #include "common/messages.h" #include "common/open-utils.h" diff --git a/cmds/qgroup.c b/cmds/qgroup.c index 4c66ee0a..d9104d1a 100644 --- a/cmds/qgroup.c +++ b/cmds/qgroup.c @@ -16,6 +16,7 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" #include #include #include @@ -25,10 +26,13 @@ #include #include #include +#include #include "libbtrfsutil/btrfsutil.h" #include "kernel-lib/list.h" #include "kernel-lib/rbtree.h" #include "kernel-lib/rbtree_types.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/ctree.h" #include "common/open-utils.h" @@ -41,6 +45,9 @@ #include "cmds/commands.h" #include "cmds/qgroup.h" +enum btrfs_qgroup_comp_enum; +enum btrfs_qgroup_filter_enum; + #define BTRFS_QGROUP_NFILTERS_INCREASE (2 * BTRFS_QGROUP_FILTER_MAX) #define BTRFS_QGROUP_NCOMPS_INCREASE (2 * BTRFS_QGROUP_COMP_MAX) diff --git a/cmds/quota.c b/cmds/quota.c index 0eac039f..fa069d79 100644 --- a/cmds/quota.c +++ b/cmds/quota.c @@ -16,6 +16,7 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" #include #include #include @@ -23,6 +24,7 @@ #include #include #include +#include #include "kernel-shared/uapi/btrfs.h" #include "common/help.h" #include "common/open-utils.h" diff --git a/cmds/receive.c b/cmds/receive.c index d16dc0ab..a50e2182 100644 --- a/cmds/receive.c +++ b/cmds/receive.c @@ -45,7 +45,6 @@ #include #endif #include "kernel-shared/uapi/btrfs.h" -#include "kernel-shared/ctree.h" #include "common/defs.h" #include "common/messages.h" #include "common/utils.h" diff --git a/cmds/reflink.c b/cmds/reflink.c index 14201349..867a5bd2 100644 --- a/cmds/reflink.c +++ b/cmds/reflink.c @@ -16,9 +16,10 @@ #include "kerncompat.h" #include +#include +#include #include #include -#include #include #include "kernel-lib/list.h" #include "common/messages.h" diff --git a/cmds/replace.c b/cmds/replace.c index 76c28fe2..138a22e4 100644 --- a/cmds/replace.c +++ b/cmds/replace.c @@ -30,7 +30,6 @@ #include #include #include "kernel-shared/uapi/btrfs.h" -#include "kernel-shared/ctree.h" #include "common/utils.h" #include "common/open-utils.h" #include "common/help.h" diff --git a/cmds/rescue-chunk-recover.c b/cmds/rescue-chunk-recover.c index faa72cdd..7998afc3 100644 --- a/cmds/rescue-chunk-recover.c +++ b/cmds/rescue-chunk-recover.c @@ -17,6 +17,7 @@ */ #include "kerncompat.h" +#include #include #include #include @@ -26,7 +27,10 @@ #include #include #include "kernel-lib/list.h" -#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent-io-tree.h" +#include "kernel-shared/locking.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" diff --git a/cmds/rescue-super-recover.c b/cmds/rescue-super-recover.c index 4a36dda1..54dcb6e1 100644 --- a/cmds/rescue-super-recover.c +++ b/cmds/rescue-super-recover.c @@ -24,6 +24,8 @@ #include #include #include "kernel-lib/list.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" diff --git a/cmds/rescue.c b/cmds/rescue.c index cf39edd3..be6f5016 100644 --- a/cmds/rescue.c +++ b/cmds/rescue.c @@ -19,15 +19,17 @@ #include "kerncompat.h" #include #include -#include #include -#include +#include +#include #include "kernel-lib/list.h" #include "kernel-shared/ctree.h" #include "kernel-shared/volumes.h" #include "kernel-shared/transaction.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/extent_io.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/messages.h" #include "common/utils.h" #include "common/help.h" diff --git a/cmds/restore.c b/cmds/restore.c index f0a60afc..4904e87b 100644 --- a/cmds/restore.c +++ b/cmds/restore.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -38,6 +39,8 @@ #if COMPRESSION_ZSTD #include #endif +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/print-tree.h" diff --git a/cmds/scrub.c b/cmds/scrub.c index 11de2214..c45ab3dd 100644 --- a/cmds/scrub.c +++ b/cmds/scrub.c @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -43,7 +42,6 @@ #include #include #include "kernel-lib/sizes.h" -#include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/volumes.h" #include "common/defs.h" #include "common/messages.h" diff --git a/cmds/send.c b/cmds/send.c index 236b0516..cd1811b5 100644 --- a/cmds/send.c +++ b/cmds/send.c @@ -18,6 +18,7 @@ #include "kerncompat.h" #include +#include #include #include #include diff --git a/cmds/subvolume-list.c b/cmds/subvolume-list.c index dd0d8a45..a583c8b6 100644 --- a/cmds/subvolume-list.c +++ b/cmds/subvolume-list.c @@ -23,9 +23,13 @@ #include #include #include +#include +#include #include #include "kernel-lib/rbtree.h" #include "kernel-lib/rbtree_types.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/ctree.h" #include "common/defs.h" @@ -39,6 +43,9 @@ #include "cmds/commands.h" #include "cmds/subvolume.h" +enum btrfs_list_comp_enum; +enum btrfs_list_filter_enum; + /* * Naming of options: * - uppercase for filters and sort options diff --git a/cmds/subvolume.c b/cmds/subvolume.c index 57029178..1540d62e 100644 --- a/cmds/subvolume.c +++ b/cmds/subvolume.c @@ -29,6 +29,8 @@ #include #include #include "libbtrfsutil/btrfsutil.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/ctree.h" #include "common/defs.h" diff --git a/common/cpu-utils.c b/common/cpu-utils.c index 568e3af5..566b86c7 100644 --- a/common/cpu-utils.c +++ b/common/cpu-utils.c @@ -15,7 +15,6 @@ */ #include -#include #include "common/cpu-utils.h" unsigned long __cpu_flags = CPU_FLAG_NONE; diff --git a/common/device-scan.c b/common/device-scan.c index d61018a8..c1cd7266 100644 --- a/common/device-scan.c +++ b/common/device-scan.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -39,6 +38,8 @@ #endif #include "kernel-lib/overflow.h" #include "kernel-lib/list.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/ctree.h" #include "kernel-shared/volumes.h" diff --git a/common/device-scan.h b/common/device-scan.h index 7e981cce..8a875832 100644 --- a/common/device-scan.h +++ b/common/device-scan.h @@ -19,6 +19,7 @@ #include "kerncompat.h" #include +#include "kernel-lib/bitops.h" #include "kernel-shared/uapi/btrfs.h" #define BTRFS_SCAN_MOUNTED (1ULL << 0) diff --git a/common/device-utils.c b/common/device-utils.c index acc91bd2..a34770f7 100644 --- a/common/device-utils.c +++ b/common/device-utils.c @@ -35,12 +35,13 @@ #include "kernel-shared/disk-io.h" #include "kernel-shared/ctree.h" #include "kernel-shared/zoned.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/device-utils.h" #include "common/sysfs-utils.h" #include "common/path-utils.h" #include "common/internal.h" #include "common/messages.h" -#include "common/utils.h" #include "common/units.h" #ifndef BLKDISCARD diff --git a/common/device-utils.h b/common/device-utils.h index b5f2e18f..853d17b5 100644 --- a/common/device-utils.h +++ b/common/device-utils.h @@ -18,10 +18,12 @@ #define __DEVICE_UTILS_H__ #include "kerncompat.h" -#include #include #include -#include "kernel-shared/uapi/btrfs.h" +#include "kernel-lib/bitops.h" + +struct btrfs_ioctl_dev_info_args; +struct stat; /* * Options for btrfs_prepare_device diff --git a/common/extent-tree-utils.c b/common/extent-tree-utils.c index ebd14755..736b21c6 100644 --- a/common/extent-tree-utils.c +++ b/common/extent-tree-utils.c @@ -15,6 +15,10 @@ */ #include "kerncompat.h" +#include +#include +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/file-item.h" diff --git a/common/extent-tree-utils.h b/common/extent-tree-utils.h index fca22b79..f03d9c43 100644 --- a/common/extent-tree-utils.h +++ b/common/extent-tree-utils.h @@ -17,6 +17,14 @@ #ifndef _EXTENT_TREE_UTILS_H_ #define _EXTENT_TREE_UTILS_H_ +#include "kerncompat.h" +#include "kernel-lib/bitops.h" + +struct btrfs_inode_item; +struct btrfs_path; +struct btrfs_root; +struct btrfs_trans_handle; + int btrfs_next_extent_item(struct btrfs_root *root, struct btrfs_path *path, u64 max_objectid); int btrfs_record_file_extent(struct btrfs_trans_handle *trans, diff --git a/common/filesystem-utils.c b/common/filesystem-utils.c index 3bcdec57..8c159365 100644 --- a/common/filesystem-utils.c +++ b/common/filesystem-utils.c @@ -20,6 +20,8 @@ #include #include #include +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/transaction.h" diff --git a/common/format-output.c b/common/format-output.c index 761c2cc3..5ddd3f20 100644 --- a/common/format-output.c +++ b/common/format-output.c @@ -22,7 +22,8 @@ #include #include #include -#include "common/defs.h" +#include "kernel-shared/uapi/btrfs.h" +#include "common/messages.h" #include "common/format-output.h" #include "common/utils.h" #include "common/units.h" diff --git a/common/fsfeatures.c b/common/fsfeatures.c index 16c6f208..80eac244 100644 --- a/common/fsfeatures.c +++ b/common/fsfeatures.c @@ -25,11 +25,11 @@ #include #include "kernel-lib/sizes.h" #include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "common/fsfeatures.h" #include "common/string-utils.h" #include "common/sysfs-utils.h" -#include "common/utils.h" #include "common/messages.h" /* diff --git a/common/help.c b/common/help.c index c75acf82..c302d375 100644 --- a/common/help.c +++ b/common/help.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "common/help.h" #include "common/string-utils.h" #include "cmds/commands.h" diff --git a/common/inject-error.c b/common/inject-error.c index 5556171f..1904a949 100644 --- a/common/inject-error.c +++ b/common/inject-error.c @@ -19,6 +19,8 @@ */ #include "inject-error.h" +#include +#include #ifdef INJECT diff --git a/common/inject-error.h b/common/inject-error.h index 58feaf75..a76ef428 100644 --- a/common/inject-error.h +++ b/common/inject-error.h @@ -17,8 +17,6 @@ #ifndef __INJECT_ERROR_H__ #define __INJECT_ERROR_H__ -#include -#include #include #ifdef INJECT diff --git a/common/messages.c b/common/messages.c index 4bbaed8b..0cdf56a7 100644 --- a/common/messages.c +++ b/common/messages.c @@ -16,6 +16,7 @@ #include #include +#include #include "common/messages.h" #include "common/utils.h" diff --git a/common/open-utils.h b/common/open-utils.h index 27000cdb..3f8c004e 100644 --- a/common/open-utils.h +++ b/common/open-utils.h @@ -19,6 +19,7 @@ #include #include +#include struct btrfs_fs_devices; diff --git a/common/parse-utils.c b/common/parse-utils.c index bb3c2bbf..e00a1f67 100644 --- a/common/parse-utils.c +++ b/common/parse-utils.c @@ -25,6 +25,7 @@ #include #include "libbtrfsutil/btrfsutil.h" #include "kernel-shared/volumes.h" +#include "kernel-shared/ctree.h" #include "kernel-shared/compression.h" #include "common/parse-utils.h" #include "common/messages.h" diff --git a/common/parse-utils.h b/common/parse-utils.h index 45219f03..47f202c6 100644 --- a/common/parse-utils.h +++ b/common/parse-utils.h @@ -18,7 +18,6 @@ #define __PARSE_UTILS_H__ #include "kerncompat.h" -#include "kernel-shared/ctree.h" u64 parse_size_from_string(const char *s); enum btrfs_csum_type parse_csum_type(const char *s); diff --git a/common/rbtree-utils.h b/common/rbtree-utils.h index a6f51def..4006c684 100644 --- a/common/rbtree-utils.h +++ b/common/rbtree-utils.h @@ -19,7 +19,8 @@ #ifndef __RBTREE_UTILS__ #define __RBTREE_UTILS__ -#include "kernel-lib/rbtree.h" +struct rb_node; +struct rb_root; /* The common insert/search/free functions */ typedef int (*rb_compare_nodes)(struct rb_node *node1, struct rb_node *node2); diff --git a/common/send-stream.c b/common/send-stream.c index e51b973d..2fda54b1 100644 --- a/common/send-stream.c +++ b/common/send-stream.c @@ -16,13 +16,15 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" #include #include #include #include #include +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/uapi/btrfs.h" -#include "kernel-shared/ctree.h" #include "kernel-shared/send.h" #include "crypto/crc32c.h" #include "common/send-stream.h" diff --git a/common/send-stream.h b/common/send-stream.h index 6649b55b..5000fb45 100644 --- a/common/send-stream.h +++ b/common/send-stream.h @@ -21,6 +21,8 @@ #include "kerncompat.h" +struct timespec; + struct btrfs_send_ops { int (*subvol)(const char *path, const u8 *uuid, u64 ctransid, void *user); diff --git a/common/send-utils.c b/common/send-utils.c index 6353e9e6..0603a650 100644 --- a/common/send-utils.c +++ b/common/send-utils.c @@ -16,6 +16,7 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" #include #include #include @@ -24,6 +25,8 @@ #include #include #include +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/ctree.h" #include "common/send-utils.h" diff --git a/common/send-utils.h b/common/send-utils.h index 7bff81a1..46f97295 100644 --- a/common/send-utils.h +++ b/common/send-utils.h @@ -21,7 +21,6 @@ #include "kerncompat.h" #include -#include "kernel-shared/ctree.h" enum subvol_search_type { subvol_search_by_root_id, diff --git a/common/sysfs-utils.h b/common/sysfs-utils.h index b82e5c88..ca8fb924 100644 --- a/common/sysfs-utils.h +++ b/common/sysfs-utils.h @@ -17,6 +17,8 @@ #ifndef __COMMON_SYSFS_UTILS__ #define __COMMON_SYSFS_UTILS__ +#include + int sysfs_open_file(const char *name); int sysfs_open_fsid_file(int fd, const char *filename); int sysfs_open_fsid_dir(int fd, const char *dirname); diff --git a/common/utils.c b/common/utils.c index 51d95c9e..ee3d5abc 100644 --- a/common/utils.c +++ b/common/utils.c @@ -19,7 +19,11 @@ #include "kerncompat.h" #include +#include #include +#include +#include +#include #include #include #include @@ -28,8 +32,9 @@ #include #include #include -#include -#include "kernel-shared/uapi/btrfs.h" +#include +#include "kernel-lib/list.h" +#include "kernel-shared/accessors.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" diff --git a/common/utils.h b/common/utils.h index a729eede..0e883e2f 100644 --- a/common/utils.h +++ b/common/utils.h @@ -20,17 +20,13 @@ #define __BTRFS_UTILS_H__ #include "kerncompat.h" -#include #include #include -#include "kernel-lib/sizes.h" -#include "kernel-shared/uapi/btrfs.h" -#include "kernel-shared/ctree.h" -#include "common/defs.h" -#include "common/internal.h" -#include "common/messages.h" +#include "kernel-shared/volumes.h" #include "common/fsfeatures.h" +struct list_head; + enum exclusive_operation { BTRFS_EXCLOP_NONE, BTRFS_EXCLOP_BALANCE, diff --git a/convert/common.c b/convert/common.c index 6c156b29..508697e2 100644 --- a/convert/common.c +++ b/convert/common.c @@ -14,6 +14,7 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" #include #include #include @@ -21,13 +22,15 @@ #include #include #include "kernel-lib/sizes.h" -#include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/ctree.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/path-utils.h" #include "common/messages.h" +#include "common/fsfeatures.h" #include "mkfs/common.h" #include "convert/common.h" diff --git a/convert/main.c b/convert/main.c index c909ec16..5d7c1e1d 100644 --- a/convert/main.c +++ b/convert/main.c @@ -82,6 +82,7 @@ #include "kerncompat.h" #include +#include #include #include #include @@ -94,6 +95,8 @@ #include #include #include "kernel-lib/sizes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" diff --git a/convert/source-fs.c b/convert/source-fs.c index f1875812..fe1ff7d0 100644 --- a/convert/source-fs.c +++ b/convert/source-fs.c @@ -19,6 +19,8 @@ #include #include #include "kernel-lib/sizes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" #include "common/internal.h" diff --git a/convert/source-fs.h b/convert/source-fs.h index 7af2ed06..3e0c270b 100644 --- a/convert/source-fs.h +++ b/convert/source-fs.h @@ -20,12 +20,11 @@ #include "kerncompat.h" #include #include +#include "kernel-shared/uapi/btrfs_tree.h" +#include "convert/common.h" -struct btrfs_convert_context; -struct btrfs_inode_item; struct btrfs_root; struct btrfs_trans_handle; -struct task_info; #define CONV_IMAGE_SUBVOL_OBJECTID BTRFS_FIRST_FREE_OBJECTID diff --git a/crypto/hash.h b/crypto/hash.h index fda89e50..4f8f668a 100644 --- a/crypto/hash.h +++ b/crypto/hash.h @@ -18,6 +18,7 @@ #define CRYPTO_HASH_H #include "kerncompat.h" +#include #define CRYPTO_HASH_SIZE_MAX 32 diff --git a/image/common.c b/image/common.c index fe0a796a..fcf997c4 100644 --- a/image/common.c +++ b/image/common.c @@ -1,8 +1,32 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License v2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 021110-1307, USA. + */ + #include "kerncompat.h" #include -#include +#include #include #include +#include +#include +#include +#include "kernel-lib/sizes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "crypto/crc32c.h" diff --git a/image/common.h b/image/common.h index a3c69f9e..25fecf66 100644 --- a/image/common.h +++ b/image/common.h @@ -20,6 +20,8 @@ #include "kerncompat.h" #include +struct btrfs_fs_info; + void csum_block(u8 *buf, size_t len); int detect_version(FILE *in); int update_disk_super_on_device(struct btrfs_fs_info *info, diff --git a/image/image-create.c b/image/image-create.c index d22606df..10d50224 100644 --- a/image/image-create.c +++ b/image/image-create.c @@ -15,16 +15,31 @@ */ #include "kerncompat.h" +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include "kernel-lib/list.h" +#include "kernel-lib/rbtree.h" +#include "kernel-lib/rbtree_types.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent-io-tree.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/file-item.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" #include "kernel-shared/tree-checker.h" -#include "crypto/crc32c.h" #include "common/internal.h" #include "common/messages.h" +#include "image/sanitize.h" #include "image/metadump.h" #include "image/common.h" diff --git a/image/image-restore.c b/image/image-restore.c index 732af14b..edd81870 100644 --- a/image/image-restore.c +++ b/image/image-restore.c @@ -15,15 +15,33 @@ */ #include "kerncompat.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include "kernel-lib/list.h" +#include "kernel-lib/rbtree.h" +#include "kernel-lib/rbtree_types.h" +#include "kernel-lib/sizes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/ctree.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" #include "kernel-shared/transaction.h" #include "kernel-shared/tree-checker.h" #include "common/internal.h" #include "common/messages.h" -#include "common/open-utils.h" +#include "common/extent-cache.h" #include "image/common.h" #include "image/metadump.h" diff --git a/image/main.c b/image/main.c index 52b46588..51cf80ad 100644 --- a/image/main.c +++ b/image/main.c @@ -17,41 +17,24 @@ */ #include "kerncompat.h" -#include -#include #include #include -#include #include #include #include #include -#include #include -#include -#include -#include "kernel-lib/list.h" -#include "kernel-lib/rbtree.h" -#include "kernel-lib/rbtree_types.h" -#include "kernel-lib/sizes.h" -#include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" -#include "kernel-shared/transaction.h" #include "kernel-shared/volumes.h" -#include "kernel-shared/extent_io.h" -#include "kernel-shared/file-item.h" -#include "kernel-shared/tree-checker.h" -#include "crypto/crc32c.h" +#include "kernel-shared/accessors.h" #include "crypto/hash.h" #include "common/internal.h" #include "common/messages.h" #include "common/cpu-utils.h" #include "common/box.h" #include "common/utils.h" -#include "common/extent-cache.h" #include "common/help.h" -#include "common/device-utils.h" #include "common/open-utils.h" #include "common/string-utils.h" #include "cmds/commands.h" diff --git a/image/sanitize.c b/image/sanitize.c index 3c2feafd..084da22e 100644 --- a/image/sanitize.c +++ b/image/sanitize.c @@ -15,9 +15,12 @@ */ #include "kerncompat.h" +#include #include #include #include "kernel-lib/rbtree.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/extent_io.h" #include "common/internal.h" diff --git a/kernel-lib/list_sort.c b/kernel-lib/list_sort.c index dd82ea7c..d157aed1 100644 --- a/kernel-lib/list_sort.c +++ b/kernel-lib/list_sort.c @@ -4,6 +4,8 @@ */ #include "kerncompat.h" +#include +#include #include "kernel-lib/list_sort.h" #include "kernel-lib/list.h" diff --git a/kernel-lib/list_sort.h b/kernel-lib/list_sort.h index 987cd5c4..20136e40 100644 --- a/kernel-lib/list_sort.h +++ b/kernel-lib/list_sort.h @@ -4,8 +4,6 @@ #ifndef _LINUX_LIST_SORT_H #define _LINUX_LIST_SORT_H -#include "kerncompat.h" - struct list_head; void list_sort(void *priv, struct list_head *head, diff --git a/kernel-lib/raid56.c b/kernel-lib/raid56.c index 6f690484..7a3b59ad 100644 --- a/kernel-lib/raid56.c +++ b/kernel-lib/raid56.c @@ -21,14 +21,15 @@ * * This file was postprocessed using unroll.pl and then ported to userspace */ +#include +#include +#include #include -#include #include "kerncompat.h" -#include "kernel-shared/ctree.h" -#include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" -#include "common/utils.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-lib/raid56.h" +#include "common/messages.h" /* * This is the C data type to use diff --git a/kernel-lib/raid56.h b/kernel-lib/raid56.h index 2418ac9c..f9075a64 100644 --- a/kernel-lib/raid56.h +++ b/kernel-lib/raid56.h @@ -23,6 +23,8 @@ #define __BTRFS_PROGS_RAID56_H__ #include "kerncompat.h" +#include +#include "kernel-lib/bitops.h" void raid6_gen_syndrome(int disks, size_t bytes, void **ptrs); int raid5_gen_result(int nr_devs, size_t stripe_len, int dest, void **data); diff --git a/kernel-lib/rbtree.c b/kernel-lib/rbtree.c index e624dead..804fbff3 100644 --- a/kernel-lib/rbtree.c +++ b/kernel-lib/rbtree.c @@ -21,7 +21,12 @@ linux/lib/rbtree.c */ +#include "kerncompat.h" +#include +#include +#include "kernel-lib/rbtree_types.h" #include "kernel-lib/rbtree_augmented.h" +#include "kernel-lib/rbtree.h" /* * red-black trees properties: https://en.wikipedia.org/wiki/Rbtree diff --git a/kernel-lib/rbtree.h b/kernel-lib/rbtree.h index 508edee0..182b6ea2 100644 --- a/kernel-lib/rbtree.h +++ b/kernel-lib/rbtree.h @@ -37,6 +37,7 @@ #include #endif /* BTRFS_FLAT_INCLUDES */ +#include #include #ifdef __cplusplus diff --git a/kernel-shared/accessors.c b/kernel-shared/accessors.c index 8a16c325..e2ad55db 100644 --- a/kernel-shared/accessors.c +++ b/kernel-shared/accessors.c @@ -4,8 +4,10 @@ */ #include "kerncompat.h" +#include +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/messages.h" -#include "kernel-shared/ctree.h" #include "kernel-shared/accessors.h" static bool check_setget_bounds(const struct extent_buffer *eb, diff --git a/kernel-shared/accessors.h b/kernel-shared/accessors.h index f8879b77..f69b51aa 100644 --- a/kernel-shared/accessors.h +++ b/kernel-shared/accessors.h @@ -4,6 +4,12 @@ #define BTRFS_ACCESSORS_H #include "kerncompat.h" +#include +#include +#include "kernel-lib/bitops.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #ifndef _static_assert #define _static_assert(expr) _Static_assert(expr, #expr) diff --git a/kernel-shared/async-thread.c b/kernel-shared/async-thread.c index 0dba068d..ed235afd 100644 --- a/kernel-shared/async-thread.c +++ b/kernel-shared/async-thread.c @@ -5,10 +5,11 @@ */ #include "kerncompat.h" +#include #include "kernel-lib/bitops.h" #include "kernel-lib/trace.h" #include "kernel-shared/async-thread.h" -#include "kernel-shared/ctree.h" +#include "common/internal.h" enum { WORK_DONE_BIT, diff --git a/kernel-shared/async-thread.h b/kernel-shared/async-thread.h index 90657605..9eeade09 100644 --- a/kernel-shared/async-thread.h +++ b/kernel-shared/async-thread.h @@ -8,7 +8,9 @@ #define BTRFS_ASYNC_THREAD_H #include "kerncompat.h" +#include #include "kernel-lib/list.h" +#include "kernel-lib/bitops.h" struct btrfs_fs_info; struct btrfs_workqueue; diff --git a/kernel-shared/backref.c b/kernel-shared/backref.c index 14f045d7..d9e8d2f2 100644 --- a/kernel-shared/backref.c +++ b/kernel-shared/backref.c @@ -17,13 +17,21 @@ */ #include "kerncompat.h" +#include +#include +#include +#include +#include "kernel-lib/list.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent_io.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/backref.h" #include "kernel-shared/ulist.h" -#include "kernel-shared/transaction.h" #include "kernel-shared/messages.h" #include "kernel-shared/tree-checker.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/internal.h" #define pr_debug(...) do { } while (0) diff --git a/kernel-shared/backref.h b/kernel-shared/backref.h index ad7012aa..be3ea8ba 100644 --- a/kernel-shared/backref.h +++ b/kernel-shared/backref.h @@ -19,8 +19,18 @@ #ifndef __BTRFS_BACKREF_H__ #define __BTRFS_BACKREF_H__ -#include "kernel-shared/ulist.h" -#include "kernel-shared/extent_io.h" +#include "kerncompat.h" +#include "kernel-lib/bitops.h" + +struct btrfs_extent_item; +struct btrfs_fs_info; +struct btrfs_inode_extref; +struct btrfs_key; +struct btrfs_path; +struct btrfs_root; +struct btrfs_trans_handle; +struct extent_buffer; +struct ulist; struct inode_fs_paths { struct btrfs_path *btrfs_path; diff --git a/kernel-shared/ctree.c b/kernel-shared/ctree.c index 92cd9600..61cf125c 100644 --- a/kernel-shared/ctree.c +++ b/kernel-shared/ctree.c @@ -16,6 +16,8 @@ * Boston, MA 021110-1307, USA. */ +#include +#include #include "kernel-lib/bitops.h" #include "kernel-lib/sizes.h" #include "kernel-shared/ctree.h" @@ -26,8 +28,6 @@ #include "kernel-shared/volumes.h" #include "common/internal.h" #include "common/messages.h" -#include "common/utils.h" -#include "check/repair.h" static int split_node(struct btrfs_trans_handle *trans, struct btrfs_root *root, struct btrfs_path *path, int level); diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h index 8bcbaaee..c1bd7503 100644 --- a/kernel-shared/ctree.h +++ b/kernel-shared/ctree.h @@ -19,19 +19,20 @@ #ifndef __BTRFS_CTREE_H__ #define __BTRFS_CTREE_H__ -#include - -#include "kernel-lib/list.h" -#include "kernel-lib/rbtree.h" #include "kerncompat.h" -#include "common/extent-cache.h" -#include "crypto/crc32c.h" +#include +#include +#include "kernel-lib/list.h" +#include "kernel-lib/bitops.h" +#include "kernel-lib/rbtree_types.h" #include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/accessors.h" #include "kernel-shared/extent-io-tree.h" #include "kernel-shared/locking.h" +#include "crypto/crc32c.h" +#include "common/extent-cache.h" struct btrfs_root; struct btrfs_trans_handle; diff --git a/kernel-shared/delayed-ref.c b/kernel-shared/delayed-ref.c index 9b24001a..2fef2002 100644 --- a/kernel-shared/delayed-ref.c +++ b/kernel-shared/delayed-ref.c @@ -17,6 +17,10 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" +#include +#include +#include "kernel-lib/rbtree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/delayed-ref.h" #include "kernel-shared/transaction.h" diff --git a/kernel-shared/delayed-ref.h b/kernel-shared/delayed-ref.h index 6f817b1f..bb3a771a 100644 --- a/kernel-shared/delayed-ref.h +++ b/kernel-shared/delayed-ref.h @@ -21,7 +21,14 @@ #define BTRFS_DELAYED_REF_H #include "kerncompat.h" +#include +#include "kernel-lib/list.h" +#include "kernel-lib/rbtree_types.h" +#include "kernel-lib/bitops.h" +#include "kernel-shared/ctree.h" +#include "kernel-shared/uapi/btrfs_tree.h" +struct btrfs_trans_handle; struct btrfs_block_rsv; /* these are the possible values of struct btrfs_delayed_ref_node->action */ diff --git a/kernel-shared/dir-item.c b/kernel-shared/dir-item.c index cb70d7c8..2251de40 100644 --- a/kernel-shared/dir-item.c +++ b/kernel-shared/dir-item.c @@ -16,10 +16,19 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" #include +#include +#include +#include +#include "kernel-lib/bitops.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" -#include "kernel-shared/transaction.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs_tree.h" + +struct btrfs_trans_handle; /* * insert a name into a directory, doing overflow properly if there is a hash diff --git a/kernel-shared/disk-io.c b/kernel-shared/disk-io.c index 0647951f..98fad290 100644 --- a/kernel-shared/disk-io.c +++ b/kernel-shared/disk-io.c @@ -16,29 +16,49 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" +#include +#include +#include #include #include -#include -#include +#include #include #include +#include #include -#include "kerncompat.h" #include "kernel-lib/bitops.h" +#include "kernel-lib/list.h" +#include "kernel-lib/rbtree.h" +#include "kernel-lib/rbtree_types.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent-io-tree.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/locking.h" +#include "kernel-shared/messages.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" #include "kernel-shared/transaction.h" #include "kernel-shared/tree-checker.h" #include "kernel-shared/zoned.h" -#include "kernel-shared/print-tree.h" #include "crypto/hash.h" -#include "crypto/crc32c.h" +#include "common/defs.h" +#include "common/extent-cache.h" +#include "common/messages.h" #include "common/utils.h" #include "common/rbtree-utils.h" #include "common/device-scan.h" #include "common/device-utils.h" +struct btrfs_fs_devices; +struct btrfs_key; +struct btrfs_super_block; +struct btrfs_trans_handle; +struct extent_buffer; +struct rb_node; + /* specified errno for check_tree_block */ #define BTRFS_BAD_BYTENR (-1) #define BTRFS_BAD_FSID (-2) diff --git a/kernel-shared/disk-io.h b/kernel-shared/disk-io.h index e276f937..68cdf5b0 100644 --- a/kernel-shared/disk-io.h +++ b/kernel-shared/disk-io.h @@ -20,10 +20,19 @@ #define __BTRFS_DISK_IO_H__ #include "kerncompat.h" -#include "kernel-shared/ctree.h" +#include +#include "kernel-lib/bitops.h" #include "kernel-lib/sizes.h" +#include "kernel-shared/ctree.h" +#include "kernel-shared/uapi/btrfs.h" struct btrfs_tree_parent_check; +struct btrfs_fs_devices; +struct btrfs_key; +struct btrfs_super_block; +struct btrfs_trans_handle; +struct extent_buffer; +struct rb_node; #define BTRFS_SUPER_MIRROR_MAX 3 #define BTRFS_SUPER_MIRROR_SHIFT 12 diff --git a/kernel-shared/extent-io-tree.c b/kernel-shared/extent-io-tree.c index d8a0e3e4..c01268c3 100644 --- a/kernel-shared/extent-io-tree.c +++ b/kernel-shared/extent-io-tree.c @@ -1,15 +1,17 @@ // SPDX-License-Identifier: GPL-2.0 #include "kerncompat.h" +#include #include "kernel-lib/trace.h" +#include "kernel-lib/rbtree.h" #include "kernel-shared/messages.h" -#include "kernel-shared/ctree.h" -#include "kernel-shared/async-thread.h" #include "kernel-shared/extent-io-tree.h" #include "kernel-shared/misc.h" #include "kernel-shared/ulist.h" #include "common/internal.h" +struct btrfs_fs_info; + /* * MODIFIED: * - temporarily define this until we can sync everything. diff --git a/kernel-shared/extent-io-tree.h b/kernel-shared/extent-io-tree.h index 58f17a29..926b0d2d 100644 --- a/kernel-shared/extent-io-tree.h +++ b/kernel-shared/extent-io-tree.h @@ -4,10 +4,13 @@ #define BTRFS_EXTENT_IO_TREE_H #include "kerncompat.h" +#include +#include +#include "kernel-lib/rbtree_types.h" #include "kernel-shared/misc.h" struct extent_changeset; -struct io_failure_record; +struct btrfs_fs_info; /* Bits for the extent state */ enum { diff --git a/kernel-shared/extent-tree.c b/kernel-shared/extent-tree.c index 988bceed..5f83ff55 100644 --- a/kernel-shared/extent-tree.c +++ b/kernel-shared/extent-tree.c @@ -16,15 +16,24 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" #include #include -#include -#include -#include "kerncompat.h" +#include +#include +#include +#include "kernel-lib/bitops.h" #include "kernel-lib/list.h" #include "kernel-lib/rbtree.h" +#include "kernel-lib/rbtree_types.h" +#include "kernel-lib/sizes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/delayed-ref.h" +#include "kernel-shared/extent-io-tree.h" +#include "kernel-shared/extent_io.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" +#include "kernel-shared/messages.h" #include "kernel-shared/print-tree.h" #include "kernel-shared/transaction.h" #include "kernel-shared/volumes.h" @@ -32,7 +41,12 @@ #include "kernel-shared/free-space-tree.h" #include "kernel-shared/zoned.h" #include "kernel-shared/file-item.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "crypto/crc32c.h" +#include "common/extent-cache.h" +#include "common/internal.h" +#include "common/messages.h" #include "common/utils.h" #define PENDING_EXTENT_INSERT 0 diff --git a/kernel-shared/extent_io.c b/kernel-shared/extent_io.c index a085c2e6..6db24e30 100644 --- a/kernel-shared/extent_io.c +++ b/kernel-shared/extent_io.c @@ -16,22 +16,25 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" #include #include -#include -#include -#include -#include #include -#include "kerncompat.h" -#include "kernel-shared/extent_io.h" +#include +#include #include "kernel-lib/list.h" #include "kernel-lib/raid56.h" #include "kernel-lib/bitmap.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent-io-tree.h" +#include "kernel-shared/extent_io.h" #include "kernel-shared/ctree.h" #include "kernel-shared/volumes.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/messages.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" +#include "common/messages.h" #include "common/utils.h" #include "common/device-utils.h" #include "common/internal.h" diff --git a/kernel-shared/extent_io.h b/kernel-shared/extent_io.h index 59be49ae..0885b941 100644 --- a/kernel-shared/extent_io.h +++ b/kernel-shared/extent_io.h @@ -20,10 +20,9 @@ #define __BTRFS_EXTENT_IO_H__ #include "kerncompat.h" -#include "common/extent-cache.h" +#include "kernel-lib/bitops.h" #include "kernel-lib/list.h" - -struct extent_io_tree; +#include "common/extent-cache.h" #define EXTENT_BUFFER_UPTODATE (1U << 0) #define EXTENT_BUFFER_DIRTY (1U << 1) diff --git a/kernel-shared/file-item.c b/kernel-shared/file-item.c index 54d7c094..34d8059e 100644 --- a/kernel-shared/file-item.c +++ b/kernel-shared/file-item.c @@ -16,15 +16,15 @@ * Boston, MA 021110-1307, USA. */ -#include -#include #include "kerncompat.h" +#include +#include #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/transaction.h" -#include "kernel-shared/print-tree.h" #include "kernel-shared/file-item.h" -#include "crypto/crc32c.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs.h" #include "common/internal.h" #define MAX_CSUM_ITEMS(r, size) ((((BTRFS_LEAF_DATA_SIZE(r->fs_info) - \ diff --git a/kernel-shared/file-item.h b/kernel-shared/file-item.h index efbe5f20..d6d9aece 100644 --- a/kernel-shared/file-item.h +++ b/kernel-shared/file-item.h @@ -4,13 +4,21 @@ #define BTRFS_FILE_ITEM_H #include "kerncompat.h" +#include +#include +#include "kernel-lib/bitops.h" +#include "kernel-shared/ctree.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/accessors.h" struct bio; struct inode; struct btrfs_ordered_sum; struct btrfs_inode; +struct btrfs_trans_handle; struct extent_map; +struct extent_buffer; +struct list_head; #define BTRFS_FILE_EXTENT_INLINE_DATA_START \ (offsetof(struct btrfs_file_extent_item, disk_bytenr)) diff --git a/kernel-shared/file.c b/kernel-shared/file.c index 8804fd4c..c51019b2 100644 --- a/kernel-shared/file.c +++ b/kernel-shared/file.c @@ -17,13 +17,20 @@ */ #include "kerncompat.h" -#include +#include +#include +#include "kernel-lib/bitops.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" -#include "kernel-shared/disk-io.h" -#include "kernel-shared/transaction.h" #include "kernel-shared/compression.h" #include "kernel-shared/file-item.h" -#include "common/utils.h" +#include "common/internal.h" +#include "common/messages.h" + +struct btrfs_trans_handle; /* * Get the first file extent that covers (part of) the given range diff --git a/kernel-shared/free-space-cache.c b/kernel-shared/free-space-cache.c index 70b0ad5f..abf17184 100644 --- a/kernel-shared/free-space-cache.c +++ b/kernel-shared/free-space-cache.c @@ -17,15 +17,22 @@ */ #include "kerncompat.h" +#include +#include +#include +#include +#include "kernel-lib/bitops.h" +#include "kernel-lib/rbtree.h" +#include "kernel-lib/sizes.h" #include "kernel-shared/ctree.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/free-space-cache.h" #include "kernel-shared/transaction.h" -#include "kernel-shared/disk-io.h" #include "kernel-shared/extent_io.h" #include "crypto/crc32c.h" -#include "kernel-lib/bitops.h" #include "common/internal.h" -#include "common/utils.h" +#include "common/messages.h" /* * Kernel always uses PAGE_CACHE_SIZE for sectorsize, but we don't have diff --git a/kernel-shared/free-space-cache.h b/kernel-shared/free-space-cache.h index d4a44b04..ce5f444b 100644 --- a/kernel-shared/free-space-cache.h +++ b/kernel-shared/free-space-cache.h @@ -20,8 +20,13 @@ #define __BTRFS_FREE_SPACE_CACHE_H__ #include "kerncompat.h" -#include "kernel-shared/ctree.h" -#include "kernel-lib/rbtree.h" +#include "kernel-lib/bitops.h" +#include "kernel-lib/list.h" +#include "kernel-lib/rbtree_types.h" + +struct btrfs_block_group; +struct btrfs_fs_info; +struct btrfs_trans_handle; struct btrfs_free_space { struct rb_node offset_index; diff --git a/kernel-shared/free-space-tree.c b/kernel-shared/free-space-tree.c index a2a3663d..e31854ce 100644 --- a/kernel-shared/free-space-tree.c +++ b/kernel-shared/free-space-tree.c @@ -16,14 +16,19 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" +#include +#include +#include "kernel-lib/bitops.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" -#include "kernel-shared/free-space-cache.h" #include "kernel-shared/free-space-tree.h" -#include "kernel-shared/volumes.h" #include "kernel-shared/transaction.h" #include "kernel-shared/messages.h" -#include "kernel-lib/bitops.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/internal.h" static struct btrfs_root *btrfs_free_space_root(struct btrfs_fs_info *fs_info, diff --git a/kernel-shared/free-space-tree.h b/kernel-shared/free-space-tree.h index e3ae38e1..a93ebe21 100644 --- a/kernel-shared/free-space-tree.h +++ b/kernel-shared/free-space-tree.h @@ -19,6 +19,13 @@ #ifndef __BTRFS_FREE_SPACE_TREE_H__ #define __BTRFS_FREE_SPACE_TREE_H__ +#include "kerncompat.h" +#include "kernel-lib/bitops.h" + +struct btrfs_block_group; +struct btrfs_fs_info; +struct btrfs_trans_handle; + #define BTRFS_FREE_SPACE_BITMAP_SIZE 256 #define BTRFS_FREE_SPACE_BITMAP_BITS (BTRFS_FREE_SPACE_BITMAP_SIZE * BITS_PER_BYTE) diff --git a/kernel-shared/inode-item.c b/kernel-shared/inode-item.c index d0705267..260d86b7 100644 --- a/kernel-shared/inode-item.c +++ b/kernel-shared/inode-item.c @@ -16,9 +16,18 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" +#include +#include +#include "kernel-lib/bitops.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" -#include "kernel-shared/transaction.h" + +struct btrfs_trans_handle; static int find_name_in_backref(struct btrfs_path *path, const char * name, int name_len, struct btrfs_inode_ref **ref_ret) diff --git a/kernel-shared/inode.c b/kernel-shared/inode.c index 139ead5f..3d420787 100644 --- a/kernel-shared/inode.c +++ b/kernel-shared/inode.c @@ -22,12 +22,17 @@ * do directly operation on extent buffer, which may cause extra searching, * but should not be a huge problem since progs is less performance sensitive. */ -#include +#include "kerncompat.h" +#include +#include +#include +#include +#include +#include #include "kernel-shared/ctree.h" #include "kernel-shared/transaction.h" #include "kernel-shared/disk-io.h" -#include "time.h" #include "common/messages.h" #include "common/internal.h" diff --git a/kernel-shared/locking.c b/kernel-shared/locking.c index bd24571e..6a866d6c 100644 --- a/kernel-shared/locking.c +++ b/kernel-shared/locking.c @@ -1,7 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0 */ +#include "kerncompat.h" #include "kernel-shared/ctree.h" #include "kernel-shared/locking.h" +#include "kernel-shared/extent_io.h" struct extent_buffer *btrfs_read_lock_root_node(struct btrfs_root *root) { diff --git a/kernel-shared/locking.h b/kernel-shared/locking.h index 045f1e4c..daab11ad 100644 --- a/kernel-shared/locking.h +++ b/kernel-shared/locking.h @@ -4,6 +4,10 @@ #define BTRFS_LOCKING_H #include "kerncompat.h" +#include +#include "kernel-lib/bitops.h" + +struct extent_buffer; #define BTRFS_WRITE_LOCK 1 #define BTRFS_READ_LOCK 2 diff --git a/kernel-shared/messages.c b/kernel-shared/messages.c index 413ef1e9..d2e96d58 100644 --- a/kernel-shared/messages.c +++ b/kernel-shared/messages.c @@ -1,10 +1,11 @@ // SPDX-License-Identifier: GPL-2.0 #include "kerncompat.h" +#include +#include #include "kernel-lib/bitops.h" #include "kernel-shared/ctree.h" #include "kernel-shared/messages.h" -#include "kernel-shared/transaction.h" #ifdef CONFIG_PRINTK diff --git a/kernel-shared/messages.h b/kernel-shared/messages.h index 50d9d665..0ae398c5 100644 --- a/kernel-shared/messages.h +++ b/kernel-shared/messages.h @@ -4,11 +4,10 @@ #define BTRFS_MESSAGES_H #include "kerncompat.h" -#include +#include "kernel-lib/bitops.h" #include "common/messages.h" struct btrfs_fs_info; -struct btrfs_trans_handle; #ifdef __KERNEL__ static inline __printf(2, 3) __cold diff --git a/kernel-shared/print-tree.c b/kernel-shared/print-tree.c index 2d55e1c2..79e22ad4 100644 --- a/kernel-shared/print-tree.c +++ b/kernel-shared/print-tree.c @@ -16,11 +16,15 @@ * Boston, MA 021110-1307, USA. */ -#include -#include -#include -#include #include "kerncompat.h" +#include +#include +#include +#include +#include +#include +#include +#include #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/print-tree.h" @@ -29,7 +33,9 @@ #include "kernel-shared/accessors.h" #include "kernel-shared/file-item.h" #include "kernel-shared/tree-checker.h" -#include "common/utils.h" +#include "common/defs.h" +#include "common/internal.h" +#include "common/messages.h" static void print_dir_item_type(struct extent_buffer *eb, struct btrfs_dir_item *di) diff --git a/kernel-shared/print-tree.h b/kernel-shared/print-tree.h index c1e75d1e..d857e1da 100644 --- a/kernel-shared/print-tree.h +++ b/kernel-shared/print-tree.h @@ -19,6 +19,15 @@ #ifndef __PRINT_TREE_H__ #define __PRINT_TREE_H__ +#include "kerncompat.h" +#include +#include "kernel-lib/bitops.h" + +struct btrfs_chunk; +struct btrfs_disk_key; +struct btrfs_super_block; +struct extent_buffer; + enum { /* Depth-first search, nodes and leaves can be interleaved */ BTRFS_PRINT_TREE_DFS = (1 << 0), diff --git a/kernel-shared/root-tree.c b/kernel-shared/root-tree.c index 730c69d4..33f9e469 100644 --- a/kernel-shared/root-tree.c +++ b/kernel-shared/root-tree.c @@ -16,10 +16,15 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" +#include +#include +#include "kernel-lib/bitops.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" -#include "kernel-shared/transaction.h" #include "kernel-shared/disk-io.h" -#include "kernel-shared/print-tree.h" int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct btrfs_root_item *item, struct btrfs_key *key) diff --git a/kernel-shared/transaction.c b/kernel-shared/transaction.c index fcd8e6e0..37ae79f4 100644 --- a/kernel-shared/transaction.c +++ b/kernel-shared/transaction.c @@ -15,11 +15,18 @@ */ #include "kerncompat.h" +#include +#include "kernel-lib/rbtree.h" #include "kernel-lib/bitops.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/transaction.h" #include "kernel-shared/delayed-ref.h" #include "kernel-shared/zoned.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/ctree.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/locking.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/messages.h" struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root, diff --git a/kernel-shared/transaction.h b/kernel-shared/transaction.h index d8b6f9fb..ca3bc9ce 100644 --- a/kernel-shared/transaction.h +++ b/kernel-shared/transaction.h @@ -21,9 +21,16 @@ #include "kerncompat.h" #include +#include +#include #include "kernel-lib/list.h" -#include "kernel-shared/ctree.h" +#include "kernel-lib/bitops.h" #include "kernel-shared/delayed-ref.h" +#include "kernel-shared/extent-io-tree.h" +#include "kernel-shared/misc.h" + +struct btrfs_fs_info; +struct btrfs_root; enum btrfs_trans_state { TRANS_STATE_RUNNING, diff --git a/kernel-shared/tree-checker.c b/kernel-shared/tree-checker.c index 0d5c62e9..00315679 100644 --- a/kernel-shared/tree-checker.c +++ b/kernel-shared/tree-checker.c @@ -17,19 +17,24 @@ #include "kerncompat.h" #include -#include #include +#include +#include +#include #include "kernel-lib/overflow.h" #include "kernel-lib/bitops.h" +#include "kernel-lib/sizes.h" #include "kernel-shared/messages.h" #include "kernel-shared/ctree.h" #include "kernel-shared/tree-checker.h" -#include "kernel-shared/disk-io.h" #include "kernel-shared/compression.h" #include "kernel-shared/volumes.h" #include "kernel-shared/misc.h" #include "kernel-shared/accessors.h" #include "kernel-shared/file-item.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/internal.h" /* diff --git a/kernel-shared/tree-checker.h b/kernel-shared/tree-checker.h index c88759dc..e03c5e5d 100644 --- a/kernel-shared/tree-checker.h +++ b/kernel-shared/tree-checker.h @@ -7,10 +7,11 @@ #define BTRFS_TREE_CHECKER_H #include "kerncompat.h" -#include "uapi/btrfs_tree.h" +#include +#include "kernel-lib/bitops.h" +#include "kernel-shared/uapi/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 { diff --git a/kernel-shared/ulist.c b/kernel-shared/ulist.c index 4243b292..eba58bbc 100644 --- a/kernel-shared/ulist.c +++ b/kernel-shared/ulist.c @@ -19,8 +19,9 @@ */ #include "kerncompat.h" +#include +#include "kernel-lib/rbtree.h" #include "kernel-shared/ulist.h" -#include "kernel-shared/ctree.h" #include "kernel-shared/messages.h" /* diff --git a/kernel-shared/ulist.h b/kernel-shared/ulist.h index 2261e6ec..10b7c103 100644 --- a/kernel-shared/ulist.h +++ b/kernel-shared/ulist.h @@ -22,8 +22,10 @@ #define __ULIST_H__ #include "kerncompat.h" +#include +#include "kernel-lib/bitops.h" +#include "kernel-lib/rbtree_types.h" #include "kernel-lib/list.h" -#include "kernel-lib/rbtree.h" /* * ulist is a generic data structure to hold a collection of unique u64 diff --git a/kernel-shared/uuid-tree.c b/kernel-shared/uuid-tree.c index 6de9a178..018499a0 100644 --- a/kernel-shared/uuid-tree.c +++ b/kernel-shared/uuid-tree.c @@ -16,14 +16,19 @@ * Boston, MA 021110-1307, USA. */ -#include -#include -#include +#include "kerncompat.h" #include +#include +#include +#include +#include "kernel-lib/bitops.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/transaction.h" -#include "kernel-shared/disk-io.h" -#include "kernel-shared/print-tree.h" +#include "common/messages.h" #include "common/utils.h" void btrfs_uuid_to_key(const u8 *uuid, struct btrfs_key *key) diff --git a/kernel-shared/volumes.c b/kernel-shared/volumes.c index 147ad30d..d86c4918 100644 --- a/kernel-shared/volumes.c +++ b/kernel-shared/volumes.c @@ -16,21 +16,27 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" +#include #include #include -#include -#include -#include #include #include +#include +#include +#include #include "kernel-lib/raid56.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/transaction.h" -#include "kernel-shared/print-tree.h" #include "kernel-shared/volumes.h" #include "kernel-shared/tree-checker.h" #include "kernel-shared/zoned.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/messages.h" +#include "common/internal.h" +#include "common/messages.h" #include "common/utils.h" #include "common/device-utils.h" diff --git a/kernel-shared/volumes.h b/kernel-shared/volumes.h index ade9d5bf..96d2287d 100644 --- a/kernel-shared/volumes.h +++ b/kernel-shared/volumes.h @@ -20,8 +20,15 @@ #define __BTRFS_VOLUMES_H__ #include "kerncompat.h" -#include "kernel-shared/ctree.h" +#include #include "kernel-lib/sizes.h" +#include "kernel-shared/ctree.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" +#include "common/extent-cache.h" + +struct btrfs_trans_handle; +struct extent_buffer; #define BTRFS_STRIPE_LEN SZ_64K #define BTRFS_STRIPE_LEN_SHIFT (16) diff --git a/kernel-shared/zoned.c b/kernel-shared/zoned.c index 100e801a..db84f89a 100644 --- a/kernel-shared/zoned.c +++ b/kernel-shared/zoned.c @@ -15,14 +15,25 @@ * Boston, MA 021110-1307, USA. */ +#include "kerncompat.h" #include +#include #include - +#include +#include +#include #include "kernel-lib/list.h" #include "kernel-shared/volumes.h" #include "kernel-shared/zoned.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/ctree.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/utils.h" #include "common/device-utils.h" +#include "common/extent-cache.h" +#include "common/internal.h" #include "common/messages.h" #include "mkfs/common.h" diff --git a/kernel-shared/zoned.h b/kernel-shared/zoned.h index 6efc6028..f4b0d5d0 100644 --- a/kernel-shared/zoned.h +++ b/kernel-shared/zoned.h @@ -19,11 +19,17 @@ #define __BTRFS_ZONED_H__ #include "kerncompat.h" +#include #include +#include "kernel-lib/bitops.h" +#include "kernel-lib/sizes.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" #include "kernel-shared/messages.h" +struct btrfs_block_group; +struct btrfs_fs_info; + #ifdef BTRFS_ZONED #include #else diff --git a/mkfs/common.c b/mkfs/common.c index 3ceb263b..d400413c 100644 --- a/mkfs/common.c +++ b/mkfs/common.c @@ -25,7 +25,6 @@ #include #include #include -#include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/ctree.h" #include "kernel-shared/accessors.h" #include "kernel-shared/disk-io.h" diff --git a/mkfs/common.h b/mkfs/common.h index 308026d9..06ddc926 100644 --- a/mkfs/common.h +++ b/mkfs/common.h @@ -25,7 +25,7 @@ #include "kerncompat.h" #include #include "kernel-lib/sizes.h" -#include "kernel-shared/ctree.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "common/defs.h" #include "common/fsfeatures.h" diff --git a/mkfs/main.c b/mkfs/main.c index c30451bd..fe41e4fd 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -33,6 +33,9 @@ #include "kernel-lib/list_sort.h" #include "kernel-lib/rbtree.h" #include "kernel-lib/sizes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/extent_io.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" diff --git a/mkfs/rootdir.c b/mkfs/rootdir.c index 2abe9a99..a413a31e 100644 --- a/mkfs/rootdir.c +++ b/mkfs/rootdir.c @@ -17,7 +17,6 @@ */ #include "kerncompat.h" - #include #include #include @@ -26,10 +25,11 @@ #include #include #include -#include #include #include #include "kernel-lib/sizes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/ctree.h" #include "kernel-shared/volumes.h" diff --git a/tune/change-csum.c b/tune/change-csum.c index f12a2832..ae8670f9 100644 --- a/tune/change-csum.c +++ b/tune/change-csum.c @@ -15,9 +15,15 @@ */ #include "kerncompat.h" +#include +#include +#include #include #include #include +#include "kernel-lib/sizes.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/volumes.h" @@ -26,7 +32,6 @@ #include "kernel-shared/transaction.h" #include "kernel-shared/tree-checker.h" #include "common/messages.h" -#include "common/internal.h" #include "common/utils.h" #include "common/inject-error.h" #include "common/extent-tree-utils.h" diff --git a/tune/change-metadata-uuid.c b/tune/change-metadata-uuid.c index 798acb6a..e8e33721 100644 --- a/tune/change-metadata-uuid.c +++ b/tune/change-metadata-uuid.c @@ -18,6 +18,8 @@ #include #include #include +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/uapi/btrfs.h" #include "kernel-shared/ctree.h" #include "kernel-shared/transaction.h" diff --git a/tune/change-uuid.c b/tune/change-uuid.c index 334b783f..810e85e1 100644 --- a/tune/change-uuid.c +++ b/tune/change-uuid.c @@ -19,7 +19,8 @@ #include #include #include -#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/extent_io.h" diff --git a/tune/convert-bgt.c b/tune/convert-bgt.c index a2915376..77cba393 100644 --- a/tune/convert-bgt.c +++ b/tune/convert-bgt.c @@ -17,6 +17,9 @@ #include "kerncompat.h" #include #include +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/transaction.h" diff --git a/tune/main.c b/tune/main.c index 7310f14b..08dedce2 100644 --- a/tune/main.c +++ b/tune/main.c @@ -17,24 +17,23 @@ */ #include "kerncompat.h" -#include #include #include #include #include #include #include +#include "kernel-shared/accessors.h" #include "kernel-shared/ctree.h" #include "kernel-shared/disk-io.h" #include "kernel-shared/transaction.h" #include "kernel-shared/volumes.h" -#include "kernel-shared/free-space-cache.h" #include "kernel-shared/free-space-tree.h" #include "common/utils.h" #include "common/open-utils.h" -#include "common/parse-utils.h" #include "common/device-scan.h" #include "common/messages.h" +#include "common/parse-utils.h" #include "common/string-utils.h" #include "common/help.h" #include "common/box.h" diff --git a/tune/seeding.c b/tune/seeding.c index 99ad455e..7a2bb50b 100644 --- a/tune/seeding.c +++ b/tune/seeding.c @@ -15,6 +15,8 @@ */ #include "kerncompat.h" +#include "kernel-shared/accessors.h" +#include "kernel-shared/uapi/btrfs_tree.h" #include "kernel-shared/ctree.h" #include "kernel-shared/transaction.h" #include "common/messages.h"