btrfs-progs: move utils.[ch] to common/

Update include paths and remove some duplicates.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2019-06-20 01:46:21 +02:00
parent 408cec5086
commit c07960c8be
64 changed files with 63 additions and 67 deletions

View File

@ -129,7 +129,7 @@ CHECKER_FLAGS := -include $(check_defs) -D__CHECKER__ \
objects = ctree.o disk-io.o kernel-lib/radix-tree.o extent-tree.o print-tree.o \
root-tree.o dir-item.o file-item.o inode-item.o inode-map.o \
extent-cache.o extent_io.o volumes.o utils.o repair.o \
extent-cache.o extent_io.o volumes.o common/utils.o repair.o \
qgroup.o free-space-cache.o kernel-lib/list_sort.o props.o \
kernel-shared/ulist.o qgroup-verify.o backref.o common/string-table.o \
common/task-utils.o \

View File

@ -30,7 +30,7 @@
#include "print-tree.h"
#include "transaction.h"
#include "list.h"
#include "utils.h"
#include "common/utils.h"
#include "common/help.h"
#define FIELD_BUF_LEN 80

View File

@ -20,7 +20,7 @@
#include <stdlib.h>
#include <unistd.h>
#include "crc32c.h"
#include "utils.h"
#include "common/utils.h"
void print_usage(int status)
{

View File

@ -31,7 +31,7 @@
#include "transaction.h"
#include "list.h"
#include "volumes.h"
#include "utils.h"
#include "common/utils.h"
#include "crc32c.h"
#include "extent-cache.h"
#include "find-root.h"

View File

@ -35,7 +35,7 @@
#include "kerncompat.h"
#include "ctree.h"
#include "ioctl.h"
#include "utils.h"
#include "common/utils.h"
static int use_color;
static void

View File

@ -28,7 +28,7 @@
#include <libgen.h>
#include "ctree.h"
#include "transaction.h"
#include "utils.h"
#include "common/utils.h"
#include "ioctl.h"
#include <uuid/uuid.h>
#include "btrfs-list.h"

View File

@ -28,7 +28,7 @@
#include "print-tree.h"
#include "transaction.h"
#include "list.h"
#include "utils.h"
#include "common/utils.h"
#include "common/help.h"
#define BUFFER_SIZE SZ_64K

View File

@ -28,7 +28,7 @@
#include "print-tree.h"
#include "transaction.h"
#include "list.h"
#include "utils.h"
#include "common/utils.h"
#include "common/help.h"
static void print_usage(void)

View File

@ -22,7 +22,7 @@
#include "volumes.h"
#include "crc32c.h"
#include "cmds/commands.h"
#include "utils.h"
#include "common/utils.h"
#include "common/help.h"
static const char * const btrfs_cmd_group_usage[] = {

View File

@ -30,7 +30,7 @@
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
#include "utils.h"
#include "common/utils.h"
#include "volumes.h"
#include "common/help.h"

View File

@ -33,7 +33,7 @@
#include "print-tree.h"
#include "common/task-utils.h"
#include "transaction.h"
#include "utils.h"
#include "common/utils.h"
#include "cmds/commands.h"
#include "free-space-cache.h"
#include "free-space-tree.h"

View File

@ -19,7 +19,7 @@
#include "common/internal.h"
#include "common/messages.h"
#include "transaction.h"
#include "utils.h"
#include "common/utils.h"
#include "disk-io.h"
#include "repair.h"
#include "check/mode-common.h"

View File

@ -23,7 +23,7 @@
#include "backref.h"
#include "hash.h"
#include "common/internal.h"
#include "utils.h"
#include "common/utils.h"
#include "volumes.h"
#include "check/mode-common.h"
#include "check/mode-lowmem.h"

View File

@ -31,7 +31,7 @@
#include "volumes.h"
#include "cmds/commands.h"
#include "utils.h"
#include "common/utils.h"
#include "common/help.h"
static const char * const balance_cmd_group_usage[] = {

View File

@ -27,7 +27,7 @@
#include "kerncompat.h"
#include "ctree.h"
#include "ioctl.h"
#include "utils.h"
#include "common/utils.h"
#include "volumes.h"
#include "cmds/filesystem-usage.h"

View File

@ -34,7 +34,7 @@
#define FIEMAP_EXTENT_SHARED 0x00002000
#endif
#include "utils.h"
#include "common/utils.h"
#include "cmds/commands.h"
#include "kerncompat.h"
#include "rbtree.h"

View File

@ -24,7 +24,7 @@
#include <getopt.h>
#include <fcntl.h>
#include "utils.h"
#include "common/utils.h"
#include "kerncompat.h"
#include "ctree.h"
#include "common/string-table.h"

View File

@ -33,7 +33,7 @@
#include "kerncompat.h"
#include "ctree.h"
#include "utils.h"
#include "common/utils.h"
#include "volumes.h"
#include "cmds/commands.h"
#include "cmds/filesystem-usage.h"

View File

@ -30,7 +30,7 @@
#include "print-tree.h"
#include "transaction.h"
#include "list.h"
#include "utils.h"
#include "common/utils.h"
#include "cmds/commands.h"
#include "crc32c.h"
#include "common/help.h"

View File

@ -30,7 +30,7 @@
#include "transaction.h"
#include "volumes.h"
#include "cmds/commands.h"
#include "utils.h"
#include "common/utils.h"
#include "common/help.h"
static void print_extents(struct extent_buffer *eb)

View File

@ -33,7 +33,7 @@
#include "transaction.h"
#include "list.h"
#include "volumes.h"
#include "utils.h"
#include "common/utils.h"
#include "cmds/commands.h"
#include "common/help.h"

View File

@ -25,7 +25,7 @@
#include "kerncompat.h"
#include "ioctl.h"
#include "utils.h"
#include "common/utils.h"
#include "ctree.h"
#include "send-utils.h"
#include "disk-io.h"

View File

@ -25,7 +25,7 @@
#include "cmds/commands.h"
#include "props.h"
#include "ctree.h"
#include "utils.h"
#include "common/utils.h"
#include "common/help.h"
static const char * const property_cmd_group_usage[] = {

View File

@ -27,7 +27,7 @@
#include "cmds/commands.h"
#include "qgroup.h"
#include "utils.h"
#include "common/utils.h"
#include "common/help.h"
static const char * const qgroup_cmd_group_usage[] = {

View File

@ -23,7 +23,7 @@
#include "ioctl.h"
#include "cmds/commands.h"
#include "utils.h"
#include "common/utils.h"
#include "common/help.h"
static const char * const quota_cmd_group_usage[] = {

View File

@ -42,7 +42,7 @@
#include "ctree.h"
#include "ioctl.h"
#include "cmds/commands.h"
#include "utils.h"
#include "common/utils.h"
#include "list.h"
#include "btrfs-list.h"

View File

@ -32,7 +32,7 @@
#include "kerncompat.h"
#include "ctree.h"
#include "ioctl.h"
#include "utils.h"
#include "common/utils.h"
#include "volumes.h"
#include "disk-io.h"

View File

@ -37,7 +37,7 @@
#include "volumes.h"
#include "transaction.h"
#include "crc32c.h"
#include "utils.h"
#include "common/utils.h"
#include "btrfsck.h"
#include "cmds/commands.h"
#include "cmds/rescue.h"

View File

@ -30,7 +30,7 @@
#include "ctree.h"
#include "disk-io.h"
#include "list.h"
#include "utils.h"
#include "common/utils.h"
#include "crc32c.h"
#include "volumes.h"
#include "cmds/commands.h"

View File

@ -24,7 +24,7 @@
#include "transaction.h"
#include "disk-io.h"
#include "cmds/commands.h"
#include "utils.h"
#include "common/utils.h"
#include "common/help.h"
#include "cmds/rescue.h"

View File

@ -43,7 +43,7 @@
#include "transaction.h"
#include "list.h"
#include "volumes.h"
#include "utils.h"
#include "common/utils.h"
#include "cmds/commands.h"
#include "common/help.h"

View File

@ -39,7 +39,7 @@
#include "ctree.h"
#include "ioctl.h"
#include "utils.h"
#include "common/utils.h"
#include "volumes.h"
#include "disk-io.h"

View File

@ -39,7 +39,7 @@
#include "ioctl.h"
#include "cmds/commands.h"
#include "list.h"
#include "utils.h"
#include "common/utils.h"
#include "send.h"
#include "send-utils.h"

View File

@ -37,9 +37,8 @@
#include "ctree.h"
#include "cmds/commands.h"
#include "utils.h"
#include "common/utils.h"
#include "btrfs-list.h"
#include "utils.h"
#include "common/help.h"
static int wait_for_subvolume_cleaning(int fd, size_t count, uint64_t *ids,

View File

@ -19,7 +19,7 @@
#include <linux/version.h>
#include "common/fsfeatures.h"
#include "ctree.h"
#include "utils.h"
#include "common/utils.h"
/*
* Insert a root item for temporary tree root

View File

@ -21,7 +21,7 @@
#include <getopt.h>
#include "cmds/commands.h"
#include "utils.h"
#include "common/utils.h"
#include "common/help.h"
#define USAGE_SHORT 1U

View File

@ -48,7 +48,7 @@
#include "disk-io.h"
#include "transaction.h"
#include "crc32c.h"
#include "utils.h"
#include "common/utils.h"
#include "volumes.h"
#include "ioctl.h"
#include "cmds/commands.h"

View File

@ -18,7 +18,7 @@
#include <uuid/uuid.h>
#include "disk-io.h"
#include "volumes.h"
#include "utils.h"
#include "common/utils.h"
#include "mkfs/common.h"
#include "convert/common.h"

View File

@ -95,7 +95,7 @@
#include "disk-io.h"
#include "volumes.h"
#include "transaction.h"
#include "utils.h"
#include "common/utils.h"
#include "common/task-utils.h"
#include "common/help.h"
#include "mkfs/common.h"

View File

@ -21,7 +21,7 @@
#include <pthread.h>
#include "disk-io.h"
#include "transaction.h"
#include "utils.h"
#include "common/utils.h"
#include "convert/common.h"
#include "convert/source-ext2.h"

View File

@ -24,7 +24,7 @@
#include <stdbool.h>
#include "disk-io.h"
#include "transaction.h"
#include "utils.h"
#include "common/utils.h"
#include "bitops.h"
#include "convert/common.h"
#include "convert/source-reiserfs.h"

View File

@ -30,7 +30,7 @@
#include "volumes.h"
#include "transaction.h"
#include "crc32c.h"
#include "utils.h"
#include "common/utils.h"
#include "print-tree.h"
#include "rbtree-utils.h"

View File

@ -30,7 +30,7 @@
#include "volumes.h"
#include "free-space-cache.h"
#include "free-space-tree.h"
#include "utils.h"
#include "common/utils.h"
#define PENDING_EXTENT_INSERT 0
#define PENDING_EXTENT_DELETE 1

View File

@ -28,7 +28,7 @@
#include "list.h"
#include "ctree.h"
#include "volumes.h"
#include "utils.h"
#include "common/utils.h"
#include "common/internal.h"
void extent_io_tree_init(struct extent_io_tree *tree)

2
file.c
View File

@ -18,7 +18,7 @@
#include <sys/stat.h>
#include "ctree.h"
#include "utils.h"
#include "common/utils.h"
#include "disk-io.h"
#include "transaction.h"
#include "kerncompat.h"

View File

@ -21,7 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "ctree.h"
#include "utils.h"
#include "common/utils.h"
#include "find-root.h"
#include "volumes.h"
#include "disk-io.h"

View File

@ -25,7 +25,7 @@
#include "crc32c.h"
#include "bitops.h"
#include "common/internal.h"
#include "utils.h"
#include "common/utils.h"
/*
* Kernel always uses PAGE_CACHE_SIZE for sectorsize, but we don't have

View File

@ -32,7 +32,7 @@
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
#include "utils.h"
#include "common/utils.h"
#include "volumes.h"
#include "extent_io.h"
#include "common/help.h"

View File

@ -17,7 +17,7 @@
#include "kerncompat.h"
#include "common/internal.h"
#include "common/messages.h"
#include "utils.h"
#include "common/utils.h"
#include "kernel-lib/crc32c.h"
#include "image/sanitize.h"
#include "extent_io.h"

View File

@ -27,7 +27,7 @@
#include "ctree.h"
#include "disk-io.h"
#include "volumes.h"
#include "utils.h"
#include "common/utils.h"
#include "kernel-lib/raid56.h"
/*

View File

@ -22,7 +22,7 @@
#include "ctree.h"
#include "disk-io.h"
#include "volumes.h"
#include "utils.h"
#include "common/utils.h"
#include "mkfs/common.h"
static u64 reference_root_table[] = {

View File

@ -36,7 +36,7 @@
#include "disk-io.h"
#include "volumes.h"
#include "transaction.h"
#include "utils.h"
#include "common/utils.h"
#include "list_sort.h"
#include "common/help.h"
#include "rbtree-utils.h"

View File

@ -31,7 +31,7 @@
#include "disk-io.h"
#include "common/messages.h"
#include "transaction.h"
#include "utils.h"
#include "common/utils.h"
#include "mkfs/rootdir.h"
#include "mkfs/common.h"
#include "send-utils.h"

View File

@ -24,8 +24,7 @@
#include "ctree.h"
#include "disk-io.h"
#include "print-tree.h"
#include "utils.h"
#include "common/utils.h"
static void print_dir_item_type(struct extent_buffer *eb,
struct btrfs_dir_item *di)

View File

@ -25,7 +25,7 @@
#include "ctree.h"
#include "cmds/commands.h"
#include "utils.h"
#include "common/utils.h"
#include "props.h"
#define XATTR_BTRFS_PREFIX "btrfs."

View File

@ -26,7 +26,7 @@
#include "ctree.h"
#include "disk-io.h"
#include "print-tree.h"
#include "utils.h"
#include "common/utils.h"
#include "kernel-shared/ulist.h"
#include "rbtree-utils.h"
#include "transaction.h"

View File

@ -20,7 +20,7 @@
#include <sys/ioctl.h>
#include "ctree.h"
#include "ioctl.h"
#include "utils.h"
#include "common/utils.h"
#include <errno.h>
#define BTRFS_QGROUP_NFILTERS_INCREASE (2 * BTRFS_QGROUP_FILTER_MAX)

View File

@ -18,7 +18,7 @@
#include "ctree.h"
#include "extent-cache.h"
#include "utils.h"
#include "common/utils.h"
#include "repair.h"
int repair = 0;

View File

@ -31,7 +31,7 @@
#include <ctype.h>
#include <asm/types.h>
#include <uuid/uuid.h>
#include "utils.h"
#include "common/utils.h"
#include "cmds/commands.h"
#include "send-utils.h"
#include "send-stream.h"

View File

@ -22,7 +22,7 @@
#include "send.h"
#include "send-stream.h"
#include "crc32c.h"
#include "utils.h"
#include "common/utils.h"
struct btrfs_send_stream {
int fd;

View File

@ -1,13 +1,11 @@
#include "kerncompat.h"
#include "utils.h"
#include "common/utils.h"
#include <unistd.h>
#include <stdlib.h>
#include <limits.h>
#include <sys/ioctl.h>
#include <ioctl.h>
#include "utils.h"
#if BTRFS_FLAT_INCLUDES
#include "ctree.h"
#else

View File

@ -23,7 +23,7 @@
#include "transaction.h"
#include "disk-io.h"
#include "print-tree.h"
#include "utils.h"
#include "common/utils.h"
void btrfs_uuid_to_key(const u8 *uuid, struct btrfs_key *key)
{

View File

@ -27,7 +27,7 @@
#include "transaction.h"
#include "print-tree.h"
#include "volumes.h"
#include "utils.h"
#include "common/utils.h"
#include "kernel-lib/raid56.h"
const struct btrfs_raid_attr btrfs_raid_array[BTRFS_NR_RAID_TYPES] = {