btrfs-progs: Split mode-original code
Subsystems (2)
cover btrfs-progs: Split mode-original code
This patchset can be fetched from github:
https://github.com/adam900710/btrfs-progs/tree/split_check_for_david
This is the remaining part of the check code split.
After the code split, the old cmds-check.c will return to make every subcommand have its own cmds-*.c.
And there will be check/mode-original.[ch] and check/mode-lowmem.[ch] to indicates the supported check mode.
As usual, some patch would be quite big so it won't reach mail list. Please check github for full change.
Qu Wenruo (3):
btrfs-progs: check: Move more shared codes to mode-common.c
btrfs-progs: Move the remaining original mode code to mode-original.c
btrfs-progs: Move check/main.c to cmds-check.c to maintain the
subcommand hierarchy
Makefile | 7 +-
btrfsck.h | 1 -
check/mode-common.c | 1724 +++++++++
check/mode-common.h | 38 +
check/{main.c => mode-original.c} | 6906 ++++++++++++-------------------------
check/mode-original.h | 32 +-
cmds-check.c | 661 ++++
7 files changed, 4724 insertions(+), 4645 deletions(-)
rename check/{main.c => mode-original.c} (76%)
create mode 100644 cmds-check.cSignature · 1 line
2.16.2
PATCH 3/3 btrfs-progs: Move check/main.c to cmds-check.c to maintain the subcommand hierarchy
cmds-check.c is back now, with include files cleaned up.
--- Makefile | 8 ++++---- check/main.c => cmds-check.c | 17 ----------------- 2 files changed, 4 insertions(+), 21 deletions(-) rename check/main.c => cmds-check.c (97%)
Makefile +4 -4
@@ -110,6 +110,7 @@ CHECKER_FLAGS := -include $(check_defs) -D__CHECKER__ \ -D__CHECK_ENDIAN__ -Wbitwise -Wuninitialized -Wshadow -Wundef \ -U_FORTIFY_SOURCE -Wdeclaration-after-statement -Wdefault-bitfield-sign +check_objects = check/mode-lowmem.o check/mode-original.o check/mode-common.o 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 \
@@ -119,12 +120,11 @@ objects = ctree.o disk-io.o kernel-lib/radix-tree.o extent-tree.o print-tree.o \ fsfeatures.o kernel-lib/tables.o kernel-lib/raid56.o transaction.o cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \ cmds-inspect.o cmds-balance.o cmds-send.o cmds-receive.o \ - cmds-quota.o cmds-qgroup.o cmds-replace.o check/main.o \ + cmds-quota.o cmds-qgroup.o cmds-replace.o cmds-check.o \ cmds-restore.o cmds-rescue.o chunk-recover.o super-recover.o \ cmds-property.o cmds-fi-usage.o cmds-inspect-dump-tree.o \ cmds-inspect-dump-super.o cmds-inspect-tree-stats.o cmds-fi-du.o \ - mkfs/common.o check/mode-common.o check/mode-lowmem.o \ - check/mode-original.o + mkfs/common.o libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o btrfs-list.o \ kernel-lib/crc32c.o messages.o \ uuid-tree.o utils-lib.o rbtree-utils.o
@@ -450,7 +450,7 @@ btrfs-%: btrfs-%.o $(objects) $(standalone_deps) $(libs_static) $(libs_static) \ $(LDFLAGS) $(LIBS) $($(subst -,_,$@-libs)) -btrfs: btrfs.o $(objects) $(cmds_objects) $(libs_static) +btrfs: btrfs.o $(objects) $(cmds_objects) $(libs_static) $(check_objects) @echo " [LD] $@" $(Q)$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(LIBS_COMP)
cmds-check.c renamed from check/main.c +0 -17
@@ -16,32 +16,15 @@* Boston, MA 021110-1307, USA. */ -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <fcntl.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <unistd.h> #include <getopt.h> #include <uuid/uuid.h> -#include "ctree.h" #include "volumes.h" #include "repair.h" #include "disk-io.h" -#include "print-tree.h" #include "task-utils.h" #include "transaction.h" #include "utils.h" -#include "commands.h" -#include "free-space-cache.h" -#include "free-space-tree.h" -#include "btrfsck.h" #include "qgroup-verify.h" -#include "rbtree-utils.h" -#include "backref.h" -#include "kernel-shared/ulist.h" -#include "hash.h" #include "help.h" #include "check/mode-common.h" #include "check/mode-original.h"
Signature · 1 line
2.16.2