Skip to content

Commit

Permalink
btrfs-progs: clean up includes, using include-what-you-use
Browse files Browse the repository at this point in the history
Signed-off-by: David Sterba <[email protected]>
  • Loading branch information
kdave committed Oct 2, 2023
1 parent d4cf2a3 commit 21aa677
Show file tree
Hide file tree
Showing 134 changed files with 590 additions and 181 deletions.
3 changes: 3 additions & 0 deletions btrfs-corrupt-block.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#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"
Expand Down
4 changes: 3 additions & 1 deletion btrfs-find-root.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@
#include <stdlib.h>
#include <getopt.h>
#include <errno.h>
#include <unistd.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"
#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"
Expand Down
4 changes: 3 additions & 1 deletion btrfs-map-logical.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
#include <errno.h>
#include <string.h>
#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"
Expand Down
2 changes: 1 addition & 1 deletion btrfs-select-super.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
#include <stdlib.h>
#include <errno.h>
#include <getopt.h>
#include <unistd.h>
#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"
Expand Down
1 change: 1 addition & 0 deletions btrfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include "kerncompat.h"
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down
8 changes: 7 additions & 1 deletion check/clear-cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@
*/

#include "kerncompat.h"
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#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"
Expand All @@ -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"
Expand Down
8 changes: 5 additions & 3 deletions check/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,22 @@
#include <stddef.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <uuid/uuid.h>
#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"
Expand Down
2 changes: 2 additions & 0 deletions check/mode-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <string.h>
#include <time.h>
#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"
Expand Down
2 changes: 2 additions & 0 deletions check/mode-common.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@
#include <sys/stat.h>
#include <stdbool.h>
#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;

Expand Down
4 changes: 3 additions & 1 deletion check/mode-lowmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
#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"
Expand Down
3 changes: 2 additions & 1 deletion check/qgroup-verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down
3 changes: 3 additions & 0 deletions check/repair.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
* Boston, MA 021110-1307, USA.
*/

#include "kerncompat.h"
#include <errno.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#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"
Expand Down
7 changes: 6 additions & 1 deletion check/repair.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions cmds/balance.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
#include <errno.h>
#include <dirent.h>
#include <stdbool.h>
#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"
Expand Down
3 changes: 1 addition & 2 deletions cmds/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@
#include <getopt.h>
#include <dirent.h>
#include <stdbool.h>
#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"
Expand Down
4 changes: 3 additions & 1 deletion cmds/filesystem-du.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <unistd.h>
#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"
Expand Down
5 changes: 4 additions & 1 deletion cmds/filesystem-usage.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
#include <sys/ioctl.h>
#include <sys/statfs.h>
#include <linux/limits.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <getopt.h>
#include <fcntl.h>
#include <dirent.h>
#include <limits.h>
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion cmds/filesystem-usage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions cmds/filesystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
Expand Down
6 changes: 5 additions & 1 deletion cmds/inspect-dump-super.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
*/

#include "kerncompat.h"
#include <sys/stat.h>
#include <linux/fs.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <getopt.h>
#include <sys/stat.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/print-tree.h"
Expand Down
7 changes: 3 additions & 4 deletions cmds/inspect-dump-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,25 @@
*/

#include "kerncompat.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <getopt.h>
#include <fcntl.h>
#include <errno.h>
#include <stdbool.h>
#include <string.h>
#include <strings.h>
#include <uuid/uuid.h>
#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"
Expand Down
7 changes: 4 additions & 3 deletions cmds/inspect-tree-stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,20 @@

#include "kerncompat.h"
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <getopt.h>
#include <string.h>
#include <stdbool.h>
#include <unistd.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/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"
Expand Down
3 changes: 3 additions & 0 deletions cmds/inspect.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <sys/statfs.h>
#include <linux/fs.h>
#include <linux/magic.h>
#include <stdbool.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -31,6 +32,8 @@
#include <unistd.h>
#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"
Expand Down
4 changes: 1 addition & 3 deletions cmds/property.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@
#include <sys/xattr.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <dirent.h>
#include <errno.h>
#include <getopt.h>
#include <stdbool.h>
#include <uuid/uuid.h>
#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"
Expand Down
Loading

0 comments on commit 21aa677

Please sign in to comment.