@@ -32,10 +32,10 @@ cmds_objects := cmds-subvolume.c cmds-filesystem.c cmds-device.c cmds-scrub.c \
cmds-inspect-dump-super.c cmds-inspect-tree-stats.c cmds-fi-du.c \
mkfs/common.c
libbtrfs_objects := send-stream.c send-utils.c kernel-lib/rbtree.c btrfs-list.c \
- kernel-lib/crc32c.c messages.c \
+ crypto/crc32c.c messages.c \
uuid-tree.c utils-lib.c rbtree-utils.c
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 \
+ crypto/crc32c.h kernel-lib/list.h kerncompat.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
blkid_objects := partition/ superblocks/ topology/
@@ -150,11 +150,11 @@ 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/filesystem-du.o \
mkfs/common.o check/mode-common.o check/mode-lowmem.o
libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o btrfs-list.o \
- kernel-lib/crc32c.o common/messages.o \
+ crypto/crc32c.o common/messages.o \
uuid-tree.o utils-lib.o common/rbtree-utils.o \
crypto/hash.o crypto/xxhash.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 \
+ crypto/crc32c.h kernel-lib/list.h kerncompat.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
libbtrfsutil_major := $(shell sed -rn 's/^\#define BTRFS_UTIL_VERSION_MAJOR ([0-9])+$$/\1/p' libbtrfsutil/btrfsutil.h)
@@ -19,7 +19,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "common/utils.h"
void print_usage(int status)
@@ -32,7 +32,7 @@
#include "kernel-lib/list.h"
#include "volumes.h"
#include "common/utils.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "extent-cache.h"
#include "find-root.h"
#include "common/help.h"
@@ -24,7 +24,7 @@
#include <string.h>
#include <limits.h>
#include <byteswap.h>
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "disk-io.h"
#define BLOCKSIZE (4096)
@@ -20,7 +20,7 @@
#include <getopt.h>
#include "volumes.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "cmds/commands.h"
#include "common/utils.h"
#include "common/help.h"
@@ -32,7 +32,7 @@
#include "kernel-lib/list.h"
#include "common/utils.h"
#include "cmds/commands.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "common/help.h"
static int check_csum_sblock(void *sb, int csum_size, u16 csum_type)
@@ -36,7 +36,7 @@
#include "disk-io.h"
#include "volumes.h"
#include "transaction.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "common/utils.h"
#include "check/common.h"
#include "cmds/commands.h"
@@ -31,7 +31,7 @@
#include "disk-io.h"
#include "kernel-lib/list.h"
#include "common/utils.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "volumes.h"
#include "cmds/commands.h"
#include "cmds/rescue.h"
@@ -47,7 +47,7 @@
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "common/utils.h"
#include "common/path-utils.h"
#include "common/device-scan.h"
@@ -102,7 +102,7 @@
#include "mkfs/common.h"
#include "convert/common.h"
#include "convert/source-fs.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "common/fsfeatures.h"
#include "common/box.h"
similarity index 99%
rename from kernel-lib/crc32c.c
rename to crypto/crc32c.c
@@ -8,7 +8,7 @@
*
*/
#include "kerncompat.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include <inttypes.h>
#include <string.h>
#include <unistd.h>
similarity index 100%
rename from kernel-lib/crc32c.h
rename to crypto/crc32c.h
@@ -29,7 +29,7 @@
#include "disk-io.h"
#include "volumes.h"
#include "transaction.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "common/utils.h"
#include "print-tree.h"
#include "common/rbtree-utils.h"
@@ -26,7 +26,7 @@
#include "disk-io.h"
#include "print-tree.h"
#include "transaction.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "volumes.h"
#include "free-space-cache.h"
#include "free-space-tree.h"
@@ -24,7 +24,7 @@
#include "disk-io.h"
#include "transaction.h"
#include "print-tree.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "common/internal.h"
#define MAX_CSUM_ITEMS(r, size) ((((BTRFS_LEAF_DATA_SIZE(r->fs_info) - \
@@ -22,7 +22,7 @@
#include "transaction.h"
#include "disk-io.h"
#include "extent_io.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "kernel-lib/bitops.h"
#include "common/internal.h"
#include "common/utils.h"
@@ -19,7 +19,7 @@
#ifndef __BTRFS_HASH_H__
#define __BTRFS_HASH_H__
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
static inline u64 btrfs_name_hash(const char *name, int len)
{
@@ -28,7 +28,7 @@
#include <getopt.h>
#include "kerncompat.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
@@ -18,7 +18,7 @@
#include "common/internal.h"
#include "common/messages.h"
#include "common/utils.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "image/sanitize.h"
#include "extent_io.h"
@@ -21,7 +21,7 @@
#include "version.h"
#include "kernel-lib/rbtree.h"
#include "kernel-lib/radix-tree.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "kernel-lib/list.h"
#include "kernel-lib/sizes.h"
#include "ctree.h"
@@ -45,7 +45,7 @@
#include "common/rbtree-utils.h"
#include "mkfs/common.h"
#include "mkfs/rootdir.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "common/fsfeatures.h"
#include "common/box.h"
@@ -21,7 +21,7 @@
#include "send.h"
#include "send-stream.h"
-#include "kernel-lib/crc32c.h"
+#include "crypto/crc32c.h"
#include "common/utils.h"
struct btrfs_send_stream {
With the introduction of xxhash64 to btrfs-progs we created a crypto/ directory for all the hashes used in btrfs (although no cryptographically secure hash is there yet). Move the crc32c implementation from kernel-lib/ to crypto/ as well so we have all hashes consolidated. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> --- Android.mk | 4 ++-- Makefile | 4 ++-- btrfs-crc.c | 2 +- btrfs-find-root.c | 2 +- btrfs-sb-mod.c | 2 +- btrfs.c | 2 +- cmds/inspect-dump-super.c | 2 +- cmds/rescue-chunk-recover.c | 2 +- cmds/rescue-super-recover.c | 2 +- common/utils.c | 2 +- convert/main.c | 2 +- {kernel-lib => crypto}/crc32c.c | 2 +- {kernel-lib => crypto}/crc32c.h | 0 disk-io.c | 2 +- extent-tree.c | 2 +- file-item.c | 2 +- free-space-cache.c | 2 +- hash.h | 2 +- image/main.c | 2 +- image/sanitize.c | 2 +- library-test.c | 2 +- mkfs/main.c | 2 +- send-stream.c | 2 +- 23 files changed, 24 insertions(+), 24 deletions(-) rename {kernel-lib => crypto}/crc32c.c (99%) rename {kernel-lib => crypto}/crc32c.h (100%)