btrfs-progs: Refactor btrfs_next_bg and its callers to use btrfs_fs_info
[platform/upstream/btrfs-progs.git] / Makefile
index b6a49e0..9e7886b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -92,10 +92,10 @@ 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 \
-         qgroup.o raid56.o free-space-cache.o kernel-lib/list_sort.o props.o \
+         qgroup.o free-space-cache.o kernel-lib/list_sort.o props.o \
          kernel-shared/ulist.o qgroup-verify.o backref.o string-table.o task-utils.o \
          inode.o file.o find-root.o free-space-tree.o help.o send-dump.o \
-         fsfeatures.o messages.o
+         fsfeatures.o kernel-lib/tables.o kernel-lib/raid56.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 cmds-check.o \
@@ -104,12 +104,12 @@ cmds_objects = cmds-subvolume.o cmds-filesystem.o cmds-device.o cmds-scrub.o \
               cmds-inspect-dump-super.o cmds-inspect-tree-stats.o cmds-fi-du.o \
               mkfs/common.o
 libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o btrfs-list.o \
-                  kernel-lib/crc32c.o \
+                  kernel-lib/crc32c.o messages.o \
                   uuid-tree.o utils-lib.o rbtree-utils.o
 libbtrfs_headers = send-stream.h send-utils.h send.h kernel-lib/rbtree.h btrfs-list.h \
               kernel-lib/crc32c.h kernel-lib/list.h kerncompat.h \
-              kernel-lib/radix-tree.h kernel-lib/sizes.h extent-cache.h \
-              extent_io.h ioctl.h ctree.h btrfsck.h version.h
+              kernel-lib/radix-tree.h kernel-lib/sizes.h kernel-lib/raid56.h \
+              extent-cache.h extent_io.h ioctl.h ctree.h btrfsck.h version.h
 convert_objects = convert/main.o convert/common.o convert/source-fs.o \
                  convert/source-ext2.o
 mkfs_objects = mkfs/main.o mkfs/common.o
@@ -276,7 +276,7 @@ test-fsck: btrfs btrfs-image btrfs-corrupt-block mkfs.btrfs
        @echo "    [TEST]   fsck-tests.sh"
        $(Q)bash tests/fsck-tests.sh
 
-test-misc: btrfs btrfs-image btrfs-corrupt-block mkfs.btrfs btrfstune
+test-misc: btrfs btrfs-image btrfs-corrupt-block mkfs.btrfs btrfstune fssum
        @echo "    [TEST]   misc-tests.sh"
        $(Q)bash tests/misc-tests.sh
 
@@ -314,6 +314,14 @@ version.h: version.sh version.h.in configure.ac
        @echo "    [SH]     $@"
        $(Q)bash ./config.status --silent $@
 
+mktables: kernel-lib/mktables.c
+       @echo "    [CC]     $@"
+       $(Q)$(CC) $(CFLAGS) $< -o $@
+
+kernel-lib/tables.c: mktables
+       @echo "    [TABLE]  $@"
+       $(Q)./mktables > $@ || ($(RM) -f $@ && exit 1)
+
 libbtrfs: $(libs_shared) $(lib_links)
 
 $(libs_shared): $(libbtrfs_objects) $(lib_links) send.h
@@ -446,7 +454,7 @@ test-ioctl: ioctl-test ioctl-test-32 ioctl-test-64
        $(Q)./ioctl-test-32 > ioctl-test-32.log
        $(Q)./ioctl-test-64 > ioctl-test-64.log
 
-library-test: library-test.c messages.o $(libs_shared)
+library-test: library-test.c $(libs_shared)
        @echo "    [TEST PREP]  $@"$(eval TMPD=$(shell mktemp -d))
        $(Q)mkdir -p $(TMPD)/include/btrfs && \
        cp $(libbtrfs_headers) $(TMPD)/include/btrfs && \
@@ -456,7 +464,7 @@ library-test: library-test.c messages.o $(libs_shared)
        @echo "    [TEST CLEAN] $@"
        $(Q)$(RM) -rf -- $(TMPD)
 
-library-test.static: library-test.c messages.static.o $(libs_static)
+library-test.static: library-test.c $(libs_static)
        @echo "    [TEST PREP]  $@"$(eval TMPD=$(shell mktemp -d))
        $(Q)mkdir -p $(TMPD)/include/btrfs && \
        cp $(libbtrfs_headers) $(TMPD)/include/btrfs && \
@@ -466,6 +474,10 @@ library-test.static: library-test.c messages.static.o $(libs_static)
        @echo "    [TEST CLEAN] $@"
        $(Q)$(RM) -rf -- $(TMPD)
 
+fssum: tests/fssum.c tests/sha224-256.c
+       @echo "    [LD]   $@"
+       $(Q)$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+
 test-build: test-build-pre test-build-real
 
 test-build-pre:
@@ -498,11 +510,13 @@ clean: $(CLEANDIRS)
        @echo "Cleaning"
        $(Q)$(RM) -f -- $(progs) *.o *.o.d \
                kernel-lib/*.o kernel-lib/*.o.d \
+               kernel-shared/*.o kernel-shared/*.o.d \
+               kernel-lib/tables.c \
                image/*.o image/*.o.d \
                convert/*.o convert/*.o.d \
                mkfs/*.o mkfs/*.o.d \
              dir-test ioctl-test quick-test library-test library-test-static \
-             btrfs.static mkfs.btrfs.static \
+              mktables btrfs.static mkfs.btrfs.static fssum \
              $(check_defs) \
              $(libs) $(lib_links) \
              $(progs_static) $(progs_extra)