btrfs-progs: move internal.h to common/

Create directory for all sources that can be used by anything that's not
rellated to a relevant kernel part, all common functions, helpers,
utilities that do not fit any other specific category.

The traditional location would be probably lib/ with all things that are
statically linked to the main binaries, but we have libbtrfs and
libbtrfsutil so this would be confusing.

Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba 2019-06-20 00:44:36 +02:00
parent 96f58629c6
commit f63f29e9e9
16 changed files with 18 additions and 18 deletions

View file

@ -613,21 +613,21 @@ tags: FORCE
@echo " [TAGS] $(TAGS_CMD)" @echo " [TAGS] $(TAGS_CMD)"
$(Q)$(TAGS_CMD) *.[ch] image/*.[ch] convert/*.[ch] mkfs/*.[ch] \ $(Q)$(TAGS_CMD) *.[ch] image/*.[ch] convert/*.[ch] mkfs/*.[ch] \
check/*.[ch] kernel-lib/*.[ch] kernel-shared/*.[ch] \ check/*.[ch] kernel-lib/*.[ch] kernel-shared/*.[ch] \
cmds/*.[ch] \ cmds/*.[ch] common/*.[ch] \
libbtrfsutil/*.[ch] libbtrfsutil/*.[ch]
etags: FORCE etags: FORCE
@echo " [ETAGS] $(ETAGS_CMD)" @echo " [ETAGS] $(ETAGS_CMD)"
$(Q)$(ETAGS_CMD) *.[ch] image/*.[ch] convert/*.[ch] mkfs/*.[ch] \ $(Q)$(ETAGS_CMD) *.[ch] image/*.[ch] convert/*.[ch] mkfs/*.[ch] \
check/*.[ch] kernel-lib/*.[ch] kernel-shared/*.[ch] \ check/*.[ch] kernel-lib/*.[ch] kernel-shared/*.[ch] \
cmds/*.[ch] \ cmds/*.[ch] common/*.[ch] \
libbtrfsutil/*.[ch] libbtrfsutil/*.[ch]
cscope: FORCE cscope: FORCE
@echo " [CSCOPE] $(CSCOPE_CMD)" @echo " [CSCOPE] $(CSCOPE_CMD)"
$(Q)ls -1 *.[ch] image/*.[ch] convert/*.[ch] mkfs/*.[ch] check/*.[ch] \ $(Q)ls -1 *.[ch] image/*.[ch] convert/*.[ch] mkfs/*.[ch] check/*.[ch] \
kernel-lib/*.[ch] kernel-shared/*.[ch] libbtrfsutil/*.[ch] \ kernel-lib/*.[ch] kernel-shared/*.[ch] libbtrfsutil/*.[ch] \
cmds/*.[ch] \ cmds/*.[ch] common/*.[ch] \
> cscope.files > cscope.files
$(Q)$(CSCOPE_CMD) $(Q)$(CSCOPE_CMD)
@ -641,7 +641,7 @@ clean: $(CLEANDIRS)
image/*.o image/*.o.d \ image/*.o image/*.o.d \
convert/*.o convert/*.o.d \ convert/*.o convert/*.o.d \
mkfs/*.o mkfs/*.o.d check/*.o check/*.o.d \ mkfs/*.o mkfs/*.o.d check/*.o check/*.o.d \
cmds/*.o cmds/*.o.d \ cmds/*.o cmds/*.o.d common/*.o common/*.o.d \
ioctl-test quick-test library-test library-test-static \ ioctl-test quick-test library-test library-test-static \
mktables btrfs.static mkfs.btrfs.static fssum \ mktables btrfs.static mkfs.btrfs.static fssum \
$(check_defs) \ $(check_defs) \

View file

@ -22,7 +22,7 @@
#include "backref.h" #include "backref.h"
#include "kernel-shared/ulist.h" #include "kernel-shared/ulist.h"
#include "transaction.h" #include "transaction.h"
#include "internal.h" #include "common/internal.h"
#define pr_debug(...) do { } while (0) #define pr_debug(...) do { } while (0)

View file

@ -16,7 +16,7 @@
#include <time.h> #include <time.h>
#include "ctree.h" #include "ctree.h"
#include "internal.h" #include "common/internal.h"
#include "messages.h" #include "messages.h"
#include "transaction.h" #include "transaction.h"
#include "utils.h" #include "utils.h"

View file

@ -22,7 +22,7 @@
#include "disk-io.h" #include "disk-io.h"
#include "backref.h" #include "backref.h"
#include "hash.h" #include "hash.h"
#include "internal.h" #include "common/internal.h"
#include "utils.h" #include "utils.h"
#include "volumes.h" #include "volumes.h"
#include "check/mode-common.h" #include "check/mode-common.h"

View file

@ -16,7 +16,7 @@
#include "kerncompat.h" #include "kerncompat.h"
#include <unistd.h> #include <unistd.h>
#include "internal.h" #include "common/internal.h"
#include "disk-io.h" #include "disk-io.h"
#include "volumes.h" #include "volumes.h"
#include "convert/common.h" #include "convert/common.h"

View file

@ -20,7 +20,7 @@
#include "transaction.h" #include "transaction.h"
#include "print-tree.h" #include "print-tree.h"
#include "repair.h" #include "repair.h"
#include "internal.h" #include "common/internal.h"
#include "sizes.h" #include "sizes.h"
#include "messages.h" #include "messages.h"
#include "volumes.h" #include "volumes.h"

View file

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

View file

@ -25,7 +25,7 @@
#include "transaction.h" #include "transaction.h"
#include "print-tree.h" #include "print-tree.h"
#include "crc32c.h" #include "crc32c.h"
#include "internal.h" #include "common/internal.h"
#define MAX_CSUM_ITEMS(r, size) ((((BTRFS_LEAF_DATA_SIZE(r->fs_info) - \ #define MAX_CSUM_ITEMS(r, size) ((((BTRFS_LEAF_DATA_SIZE(r->fs_info) - \
sizeof(struct btrfs_item) * 2) / \ sizeof(struct btrfs_item) * 2) / \

View file

@ -24,7 +24,7 @@
#include "extent_io.h" #include "extent_io.h"
#include "crc32c.h" #include "crc32c.h"
#include "bitops.h" #include "bitops.h"
#include "internal.h" #include "common/internal.h"
#include "utils.h" #include "utils.h"
/* /*

View file

@ -23,7 +23,7 @@
#include "volumes.h" #include "volumes.h"
#include "transaction.h" #include "transaction.h"
#include "bitops.h" #include "bitops.h"
#include "internal.h" #include "common/internal.h"
static struct btrfs_free_space_info * static struct btrfs_free_space_info *
search_free_space_info(struct btrfs_trans_handle *trans, search_free_space_info(struct btrfs_trans_handle *trans,

View file

@ -15,7 +15,7 @@
*/ */
#include "kerncompat.h" #include "kerncompat.h"
#include "internal.h" #include "common/internal.h"
#include "messages.h" #include "messages.h"
#include "utils.h" #include "utils.h"
#include "kernel-lib/crc32c.h" #include "kernel-lib/crc32c.h"

View file

@ -19,7 +19,7 @@
#include "ctree.h" #include "ctree.h"
#include "disk-io.h" #include "disk-io.h"
#include "transaction.h" #include "transaction.h"
#include "internal.h" #include "common/internal.h"
/* /*
* walks the btree of allocated inodes and find a hole. * walks the btree of allocated inodes and find a hole.

View file

@ -3,7 +3,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <endian.h> #include <endian.h>
#include "internal.h" #include "common/internal.h"
#ifndef DIV_ROUND_UP #ifndef DIV_ROUND_UP
#define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d)) #define DIV_ROUND_UP(n, d) (((n) + (d) - 1) / (d))

View file

@ -27,7 +27,7 @@
#include <ftw.h> #include <ftw.h>
#include "ctree.h" #include "ctree.h"
#include "volumes.h" #include "volumes.h"
#include "internal.h" #include "common/internal.h"
#include "disk-io.h" #include "disk-io.h"
#include "messages.h" #include "messages.h"
#include "transaction.h" #include "transaction.h"

View file

@ -24,7 +24,7 @@
#include <dirent.h> #include <dirent.h>
#include <stdarg.h> #include <stdarg.h>
#include "common-defs.h" #include "common-defs.h"
#include "internal.h" #include "common/internal.h"
#include "btrfs-list.h" #include "btrfs-list.h"
#include "sizes.h" #include "sizes.h"
#include "messages.h" #include "messages.h"