btrfs-progs: common: reorder includes

The preferred order:
- system headers
- standard headers
- libraries
- kernel library
- kernel shared
- common headers
- other tools
- own headers

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2022-09-14 17:06:52 +02:00
parent 8802a81eb8
commit 272bff8978
14 changed files with 36 additions and 43 deletions

View File

@ -20,6 +20,7 @@
#include "kerncompat.h"
#include <sys/ioctl.h>
#include <sys/sysmacros.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@ -29,12 +30,15 @@
#include <dirent.h>
#include <blkid/blkid.h>
#include <uuid/uuid.h>
#include <sys/sysmacros.h>
#ifdef HAVE_LIBUDEV
#include <sys/stat.h>
#include <libudev.h>
#endif
#include "kernel-lib/overflow.h"
#include "kernel-shared/ctree.h"
#include "kernel-shared/volumes.h"
#include "kernel-shared/disk-io.h"
#include "kernel-shared/zoned.h"
#include "common/path-utils.h"
#include "common/device-scan.h"
#include "common/messages.h"
@ -42,10 +46,6 @@
#include "common/defs.h"
#include "common/open-utils.h"
#include "common/units.h"
#include "kernel-shared/ctree.h"
#include "kernel-shared/volumes.h"
#include "kernel-shared/disk-io.h"
#include "kernel-shared/zoned.h"
#include "ioctl.h"
static int btrfs_scan_done = 0;

View File

@ -17,6 +17,9 @@
#include <sys/ioctl.h>
#include <sys/statfs.h>
#include <sys/types.h>
#include <linux/limits.h>
#include <linux/fs.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -24,9 +27,6 @@
#include <fcntl.h>
#include <dirent.h>
#include <blkid/blkid.h>
#include <linux/limits.h>
#include <linux/fs.h>
#include <limits.h>
#include "kernel-lib/sizes.h"
#include "kernel-shared/disk-io.h"
#include "kernel-shared/zoned.h"

View File

@ -17,10 +17,10 @@
#ifndef __DEVICE_UTILS_H__
#define __DEVICE_UTILS_H__
#include "kerncompat.h"
#include <sys/stat.h>
#include <stdbool.h>
#include <unistd.h>
#include "kerncompat.h"
#include "sys/stat.h"
/*
* Options for btrfs_prepare_device

View File

@ -16,9 +16,9 @@
* Boston, MA 021110-1307, USA.
*/
#include "kerncompat.h"
#include <stdio.h>
#include <stdlib.h>
#include "kerncompat.h"
#include "common/extent-cache.h"
#include "common/rbtree-utils.h"

View File

@ -19,8 +19,8 @@
#include <sys/ioctl.h>
#include <linux/version.h>
#include <unistd.h>
#include "common/fsfeatures.h"
#include "kernel-shared/ctree.h"
#include "common/fsfeatures.h"
#include "common/utils.h"
/*

View File

@ -19,10 +19,9 @@
#include <string.h>
#include <limits.h>
#include <getopt.h>
#include "cmds/commands.h"
#include "common/utils.h"
#include "common/help.h"
#include "cmds/commands.h"
#define USAGE_SHORT 1U
#define USAGE_LONG 2U

View File

@ -17,9 +17,9 @@
#include "kerncompat.h"
#include <limits.h>
#include <ctype.h>
#include "kernel-shared/volumes.h"
#include "common/parse-utils.h"
#include "common/messages.h"
#include "kernel-shared/volumes.h"
int parse_u64(const char *str, u64 *result)
{

View File

@ -16,12 +16,11 @@
* Boston, MA 021110-1307, USA.
*/
#include <uuid/uuid.h>
#include <unistd.h>
#include <uuid/uuid.h>
#include "kernel-shared/send.h"
#include "common/send-stream.h"
#include "crypto/crc32c.h"
#include "common/send-stream.h"
#include "common/utils.h"
struct btrfs_send_attribute {

View File

@ -16,13 +16,12 @@
* Boston, MA 021110-1307, USA.
*/
#include <sys/ioctl.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <uuid/uuid.h>
#include <limits.h>
#include <errno.h>
#include <uuid/uuid.h>
#include "kernel-shared/ctree.h"
#include "common/send-utils.h"
#include "common/messages.h"

View File

@ -20,8 +20,8 @@
#define __BTRFS_SEND_UTILS_H__
#include "kerncompat.h"
#include "kernel-shared/ctree.h"
#include "kernel-lib/rbtree.h"
#include "kernel-shared/ctree.h"
enum subvol_search_type {
subvol_search_by_root_id,

View File

@ -18,7 +18,6 @@
#include <string.h>
#include <stdio.h>
#include <stdarg.h>
#include "common/string-table.h"
/*

View File

@ -14,13 +14,12 @@
* Boston, MA 021110-1307, USA.
*/
#include <pthread.h>
#include <sys/timerfd.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <time.h>
#include "common/task-utils.h"
struct task_info *task_init(void *(*threadfn)(void *), int (*postfn)(void *),

View File

@ -17,43 +17,41 @@
* Boston, MA 021110-1307, USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "kerncompat.h"
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/sysinfo.h>
#include <uuid/uuid.h>
#include <sys/vfs.h>
#include <sys/statfs.h>
#include <sys/stat.h>
#include <linux/magic.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <mntent.h>
#include <ctype.h>
#include <limits.h>
#include <blkid/blkid.h>
#include <sys/vfs.h>
#include <sys/statfs.h>
#include <linux/magic.h>
#include <getopt.h>
#include <blkid/blkid.h>
#include <uuid/uuid.h>
#include <btrfsutil.h>
#include "kerncompat.h"
#include "kernel-lib/radix-tree.h"
#include "kernel-shared/ctree.h"
#include "kernel-shared/disk-io.h"
#include "kernel-shared/volumes.h"
#include "kernel-shared/transaction.h"
#include "crypto/crc32c.h"
#include "common/utils.h"
#include "common/path-utils.h"
#include "common/device-scan.h"
#include "common/parse-utils.h"
#include "kernel-shared/volumes.h"
#include "ioctl.h"
#include "cmds/commands.h"
#include "common/open-utils.h"
#include "cmds/commands.h"
#include "mkfs/common.h"
#include "ioctl.h"
static int rand_seed_initialized = 0;
static unsigned short rand_seed[3];

View File

@ -20,15 +20,15 @@
#define __BTRFS_UTILS_H__
#include <sys/stat.h>
#include "kernel-shared/ctree.h"
#include <dirent.h>
#include <stdarg.h>
#include "kernel-lib/sizes.h"
#include "kernel-shared/ctree.h"
#include "common/defs.h"
#include "common/internal.h"
#include "kernel-lib/sizes.h"
#include "common/messages.h"
#include "ioctl.h"
#include "common/fsfeatures.h"
#include "ioctl.h"
enum exclusive_operation {
BTRFS_EXCLOP_NONE,