linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Thumshirn <jthumshirn@suse.de>
To: David Sterba <dsterba@suse.com>
Cc: Linux BTRFS Mailinglist <linux-btrfs@vger.kernel.org>,
	Johannes Thumshirn <jthumshirn@suse.de>
Subject: [PATCH v4 11/12] btrfs-progs: move crc32c implementation to crypto/
Date: Tue,  3 Sep 2019 17:00:45 +0200	[thread overview]
Message-ID: <20190903150046.14926-12-jthumshirn@suse.de> (raw)
In-Reply-To: <20190903150046.14926-1-jthumshirn@suse.de>

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%)

diff --git a/Android.mk b/Android.mk
index e8de47eb4617..8288ba7356f4 100644
--- a/Android.mk
+++ b/Android.mk
@@ -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/
diff --git a/Makefile b/Makefile
index 45530749e2b9..c241c22d1018 100644
--- a/Makefile
+++ b/Makefile
@@ -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)
diff --git a/btrfs-crc.c b/btrfs-crc.c
index bcf25df8b46a..c4f81fc65f67 100644
--- a/btrfs-crc.c
+++ b/btrfs-crc.c
@@ -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)
diff --git a/btrfs-find-root.c b/btrfs-find-root.c
index e46fa8723b33..741eb9a95ac5 100644
--- a/btrfs-find-root.c
+++ b/btrfs-find-root.c
@@ -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"
diff --git a/btrfs-sb-mod.c b/btrfs-sb-mod.c
index 105b556b0cf1..348991b39451 100644
--- a/btrfs-sb-mod.c
+++ b/btrfs-sb-mod.c
@@ -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)
diff --git a/btrfs.c b/btrfs.c
index 6c8aabe24dc8..72dad6fb3983 100644
--- a/btrfs.c
+++ b/btrfs.c
@@ -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"
diff --git a/cmds/inspect-dump-super.c b/cmds/inspect-dump-super.c
index f9f38751f429..ef3d9094e661 100644
--- a/cmds/inspect-dump-super.c
+++ b/cmds/inspect-dump-super.c
@@ -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)
diff --git a/cmds/rescue-chunk-recover.c b/cmds/rescue-chunk-recover.c
index 329a608dfc6b..bf35693ddbfa 100644
--- a/cmds/rescue-chunk-recover.c
+++ b/cmds/rescue-chunk-recover.c
@@ -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"
diff --git a/cmds/rescue-super-recover.c b/cmds/rescue-super-recover.c
index ea3a00caf56c..5d6bea836c8b 100644
--- a/cmds/rescue-super-recover.c
+++ b/cmds/rescue-super-recover.c
@@ -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"
diff --git a/common/utils.c b/common/utils.c
index f2a10cccca86..fa49c01ad102 100644
--- a/common/utils.c
+++ b/common/utils.c
@@ -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"
diff --git a/convert/main.c b/convert/main.c
index 5eb2a59fb68a..fdbddc846e39 100644
--- a/convert/main.c
+++ b/convert/main.c
@@ -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"
 
diff --git a/kernel-lib/crc32c.c b/crypto/crc32c.c
similarity index 99%
rename from kernel-lib/crc32c.c
rename to crypto/crc32c.c
index 36bb6f189971..bd6283d5baeb 100644
--- a/kernel-lib/crc32c.c
+++ b/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>
diff --git a/kernel-lib/crc32c.h b/crypto/crc32c.h
similarity index 100%
rename from kernel-lib/crc32c.h
rename to crypto/crc32c.h
diff --git a/disk-io.c b/disk-io.c
index ce0b746f4db9..4093982cf3dc 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -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"
diff --git a/extent-tree.c b/extent-tree.c
index 932af2c644bd..a8f57776bd73 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -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"
diff --git a/file-item.c b/file-item.c
index c6e9d212bcab..64af57693baf 100644
--- a/file-item.c
+++ b/file-item.c
@@ -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) - \
diff --git a/free-space-cache.c b/free-space-cache.c
index 8a57f86dc650..6e7d7e1ef561 100644
--- a/free-space-cache.c
+++ b/free-space-cache.c
@@ -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"
diff --git a/hash.h b/hash.h
index 5398e8869316..51e842047093 100644
--- a/hash.h
+++ b/hash.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)
 {
diff --git a/image/main.c b/image/main.c
index 1265152cf524..92ee28d7fe1a 100644
--- a/image/main.c
+++ b/image/main.c
@@ -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"
diff --git a/image/sanitize.c b/image/sanitize.c
index 9caa5deaf2dd..cd2bd6fe2379 100644
--- a/image/sanitize.c
+++ b/image/sanitize.c
@@ -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"
 
diff --git a/library-test.c b/library-test.c
index c44bad228e50..e47917c25830 100644
--- a/library-test.c
+++ b/library-test.c
@@ -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"
diff --git a/mkfs/main.c b/mkfs/main.c
index 64806dac7706..a46205e7237f 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -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"
 
diff --git a/send-stream.c b/send-stream.c
index 08687e5e6904..3b8ada2110aa 100644
--- a/send-stream.c
+++ b/send-stream.c
@@ -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 {
-- 
2.16.4


  parent reply	other threads:[~2019-09-03 15:01 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 15:00 [PATCH v4 00/12] btrfs-progs: support xxhash64 checksums Johannes Thumshirn
2019-09-03 15:00 ` [PATCH v4 01/12] btrfs-progs: don't blindly assume crc32c in csum_tree_block_size() Johannes Thumshirn
2019-09-24 12:56   ` David Sterba
2019-09-24 13:06   ` David Sterba
2019-09-03 15:00 ` [PATCH v4 02/12] btrfs-progs: cache csum_type in recover_control Johannes Thumshirn
2019-09-03 15:00 ` [PATCH v4 03/12] btrfs-progs: add checksum type to checksumming functions Johannes Thumshirn
2019-09-03 15:00 ` [PATCH v4 04/12] btrfs-progs: don't assume checksums are always 4 bytes Johannes Thumshirn
2019-09-03 15:00 ` [PATCH v4 05/12] btrfs-progs: pass checksum type to btrfs_csum_data()/btrfs_csum_final() Johannes Thumshirn
2019-09-03 15:00 ` [PATCH v4 06/12] btrfs-progs: simplify update_block_csum() in btrfs-sb-mod.c Johannes Thumshirn
2019-09-03 15:00 ` [PATCH v4 07/12] btrfs-progs: update checksumming api Johannes Thumshirn
2019-09-03 15:00 ` [PATCH v4 08/12] btrfs-progs: add option for checksum type to mkfs Johannes Thumshirn
2019-09-24 14:26   ` David Sterba
2019-09-24 15:34     ` Adam Borowski
2019-09-24 15:52       ` David Sterba
2019-09-03 15:00 ` [PATCH v4 09/12] btrfs-progs: add xxhash sources Johannes Thumshirn
2019-09-03 15:00 ` [PATCH v4 10/12] btrfs-progs: add xxhash64 as checksum algorithm Johannes Thumshirn
2019-09-04  8:31   ` Nikolay Borisov
2019-09-24 14:23   ` David Sterba
2019-09-03 15:00 ` Johannes Thumshirn [this message]
2019-09-04  8:32   ` [PATCH v4 11/12] btrfs-progs: move crc32c implementation to crypto/ Nikolay Borisov
2019-09-03 15:00 ` [PATCH v4 12/12] btrfs-progs: add test-case for mkfs with xxhash64 Johannes Thumshirn
2019-09-24 14:26   ` David Sterba
2019-09-24 14:34 ` [PATCH v4 00/12] btrfs-progs: support xxhash64 checksums David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190903150046.14926-12-jthumshirn@suse.de \
    --to=jthumshirn@suse.de \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).