Skip to content

Commit c04bcdc

Browse files
Johannes Thumshirnkdave
Johannes Thumshirn
authored andcommittedNov 18, 2019
btrfs-progs: move crc32c implementation to crypto/
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> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent f070ece commit c04bcdc

23 files changed

+24
-24
lines changed
 

‎Android.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ cmds_objects := cmds-subvolume.c cmds-filesystem.c cmds-device.c cmds-scrub.c \
3232
cmds-inspect-dump-super.c cmds-inspect-tree-stats.c cmds-fi-du.c \
3333
mkfs/common.c
3434
libbtrfs_objects := send-stream.c send-utils.c kernel-lib/rbtree.c btrfs-list.c \
35-
kernel-lib/crc32c.c messages.c \
35+
crypto/crc32c.c messages.c \
3636
uuid-tree.c utils-lib.c rbtree-utils.c
3737
libbtrfs_headers := send-stream.h send-utils.h send.h kernel-lib/rbtree.h btrfs-list.h \
38-
kernel-lib/crc32c.h kernel-lib/list.h kerncompat.h \
38+
crypto/crc32c.h kernel-lib/list.h kerncompat.h \
3939
kernel-lib/radix-tree.h kernel-lib/sizes.h kernel-lib/raid56.h \
4040
extent-cache.h extent_io.h ioctl.h ctree.h btrfsck.h version.h
4141
blkid_objects := partition/ superblocks/ topology/

‎Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ cmds_objects = cmds/subvolume.o cmds/filesystem.o cmds/device.o cmds/scrub.o \
149149
mkfs/common.o check/mode-common.o check/mode-lowmem.o
150150
libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o btrfs-list.o \
151151
kernel-lib/radix-tree.o extent-cache.o extent_io.o \
152-
kernel-lib/crc32c.o common/messages.o \
152+
crypto/crc32c.o common/messages.o \
153153
uuid-tree.o utils-lib.o common/rbtree-utils.o \
154154
ctree.o disk-io.o extent-tree.o delayed-ref.o print-tree.o \
155155
free-space-cache.o root-tree.o volumes.o transaction.o \
@@ -159,7 +159,7 @@ libbtrfs_objects = send-stream.o send-utils.o kernel-lib/rbtree.o btrfs-list.o \
159159
common/utils.o libbtrfsutil/subvolume.o libbtrfsutil/stubs.o \
160160
crypto/hash.o crypto/xxhash.o
161161
libbtrfs_headers = send-stream.h send-utils.h send.h kernel-lib/rbtree.h btrfs-list.h \
162-
kernel-lib/crc32c.h kernel-lib/list.h kerncompat.h \
162+
crypto/crc32c.h kernel-lib/list.h kerncompat.h \
163163
kernel-lib/radix-tree.h kernel-lib/sizes.h kernel-lib/raid56.h \
164164
extent-cache.h extent_io.h ioctl.h ctree.h btrfsck.h version.h
165165
libbtrfsutil_major := $(shell sed -rn 's/^\#define BTRFS_UTIL_VERSION_MAJOR ([0-9])+$$/\1/p' libbtrfsutil/btrfsutil.h)

‎btrfs-crc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <stdio.h>
2020
#include <stdlib.h>
2121
#include <unistd.h>
22-
#include "kernel-lib/crc32c.h"
22+
#include "crypto/crc32c.h"
2323
#include "common/utils.h"
2424

2525
void print_usage(int status)

‎btrfs-find-root.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "kernel-lib/list.h"
3333
#include "volumes.h"
3434
#include "common/utils.h"
35-
#include "kernel-lib/crc32c.h"
35+
#include "crypto/crc32c.h"
3636
#include "extent-cache.h"
3737
#include "find-root.h"
3838
#include "common/help.h"

‎btrfs-sb-mod.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <string.h>
2525
#include <limits.h>
2626
#include <byteswap.h>
27-
#include "kernel-lib/crc32c.h"
27+
#include "crypto/crc32c.h"
2828
#include "disk-io.h"
2929

3030
#define BLOCKSIZE (4096)

‎btrfs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <getopt.h>
2121

2222
#include "volumes.h"
23-
#include "kernel-lib/crc32c.h"
23+
#include "crypto/crc32c.h"
2424
#include "cmds/commands.h"
2525
#include "common/utils.h"
2626
#include "common/help.h"

‎cmds/inspect-dump-super.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "kernel-lib/list.h"
3333
#include "common/utils.h"
3434
#include "cmds/commands.h"
35-
#include "kernel-lib/crc32c.h"
35+
#include "crypto/crc32c.h"
3636
#include "common/help.h"
3737

3838
static int check_csum_sblock(void *sb, int csum_size, u16 csum_type)

‎cmds/rescue-chunk-recover.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#include "disk-io.h"
3737
#include "volumes.h"
3838
#include "transaction.h"
39-
#include "kernel-lib/crc32c.h"
39+
#include "crypto/crc32c.h"
4040
#include "common/utils.h"
4141
#include "check/common.h"
4242
#include "cmds/commands.h"

‎cmds/rescue-super-recover.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#include "disk-io.h"
3232
#include "kernel-lib/list.h"
3333
#include "common/utils.h"
34-
#include "kernel-lib/crc32c.h"
34+
#include "crypto/crc32c.h"
3535
#include "volumes.h"
3636
#include "cmds/commands.h"
3737
#include "cmds/rescue.h"

‎common/utils.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#include "ctree.h"
4848
#include "disk-io.h"
4949
#include "transaction.h"
50-
#include "kernel-lib/crc32c.h"
50+
#include "crypto/crc32c.h"
5151
#include "common/utils.h"
5252
#include "common/path-utils.h"
5353
#include "common/device-scan.h"

‎convert/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
#include "mkfs/common.h"
103103
#include "convert/common.h"
104104
#include "convert/source-fs.h"
105-
#include "kernel-lib/crc32c.h"
105+
#include "crypto/crc32c.h"
106106
#include "common/fsfeatures.h"
107107
#include "common/box.h"
108108

‎kernel-lib/crc32c.c ‎crypto/crc32c.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*/
1010
#include "kerncompat.h"
11-
#include "kernel-lib/crc32c.h"
11+
#include "crypto/crc32c.h"
1212
#include <inttypes.h>
1313
#include <string.h>
1414
#include <unistd.h>
File renamed without changes.

‎disk-io.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "disk-io.h"
3030
#include "volumes.h"
3131
#include "transaction.h"
32-
#include "kernel-lib/crc32c.h"
32+
#include "crypto/crc32c.h"
3333
#include "common/utils.h"
3434
#include "print-tree.h"
3535
#include "common/rbtree-utils.h"

‎extent-tree.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#include "disk-io.h"
2727
#include "print-tree.h"
2828
#include "transaction.h"
29-
#include "kernel-lib/crc32c.h"
29+
#include "crypto/crc32c.h"
3030
#include "volumes.h"
3131
#include "free-space-cache.h"
3232
#include "free-space-tree.h"

‎file-item.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include "disk-io.h"
2525
#include "transaction.h"
2626
#include "print-tree.h"
27-
#include "kernel-lib/crc32c.h"
27+
#include "crypto/crc32c.h"
2828
#include "common/internal.h"
2929

3030
#define MAX_CSUM_ITEMS(r, size) ((((BTRFS_LEAF_DATA_SIZE(r->fs_info) - \

‎free-space-cache.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include "transaction.h"
2323
#include "disk-io.h"
2424
#include "extent_io.h"
25-
#include "kernel-lib/crc32c.h"
25+
#include "crypto/crc32c.h"
2626
#include "kernel-lib/bitops.h"
2727
#include "common/internal.h"
2828
#include "common/utils.h"

‎hash.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#ifndef __BTRFS_HASH_H__
2020
#define __BTRFS_HASH_H__
2121

22-
#include "kernel-lib/crc32c.h"
22+
#include "crypto/crc32c.h"
2323

2424
static inline u64 btrfs_name_hash(const char *name, int len)
2525
{

‎image/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#include <getopt.h>
2929

3030
#include "kerncompat.h"
31-
#include "kernel-lib/crc32c.h"
31+
#include "crypto/crc32c.h"
3232
#include "ctree.h"
3333
#include "disk-io.h"
3434
#include "transaction.h"

‎image/sanitize.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include "common/internal.h"
1919
#include "common/messages.h"
2020
#include "common/utils.h"
21-
#include "kernel-lib/crc32c.h"
21+
#include "crypto/crc32c.h"
2222
#include "image/sanitize.h"
2323
#include "extent_io.h"
2424

‎library-test.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "version.h"
2222
#include "kernel-lib/rbtree.h"
2323
#include "kernel-lib/radix-tree.h"
24-
#include "kernel-lib/crc32c.h"
24+
#include "crypto/crc32c.h"
2525
#include "kernel-lib/list.h"
2626
#include "kernel-lib/sizes.h"
2727
#include "ctree.h"

‎mkfs/main.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include "common/rbtree-utils.h"
4646
#include "mkfs/common.h"
4747
#include "mkfs/rootdir.h"
48-
#include "kernel-lib/crc32c.h"
48+
#include "crypto/crc32c.h"
4949
#include "common/fsfeatures.h"
5050
#include "common/box.h"
5151

‎send-stream.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
#include "send.h"
2323
#include "send-stream.h"
24-
#include "kernel-lib/crc32c.h"
24+
#include "crypto/crc32c.h"
2525
#include "common/utils.h"
2626

2727
struct btrfs_send_stream {

0 commit comments

Comments
 (0)
Please sign in to comment.