Although moderm hardware is fast enough and crc32 calculation is not a
hotspot, doing such optimization won't hurt anyway.

Signed-off-by: Qu Wenruo <w...@suse.com>
---
 convert/main.c | 2 ++
 mkfs/main.c    | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/convert/main.c b/convert/main.c
index 68f76f716be9..31e54a5c000e 100644
--- a/convert/main.c
+++ b/convert/main.c
@@ -101,6 +101,7 @@
 #include "mkfs/common.h"
 #include "convert/common.h"
 #include "convert/source-fs.h"
+#include "kernel-lib/crc32c.h"
 #include "fsfeatures.h"
 
 extern const struct btrfs_convert_operations ext2_convert_ops;
@@ -1845,6 +1846,7 @@ int main(int argc, char *argv[])
                return 1;
        }
 
+       crc32c_optimization_init();
        if (rollback) {
                ret = do_rollback(file);
        } else {
diff --git a/mkfs/main.c b/mkfs/main.c
index 1d03ec52ddd6..5727d61df2d7 100644
--- a/mkfs/main.c
+++ b/mkfs/main.c
@@ -42,6 +42,7 @@
 #include "rbtree-utils.h"
 #include "mkfs/common.h"
 #include "mkfs/rootdir.h"
+#include "kernel-lib/crc32c.h"
 #include "fsfeatures.h"
 
 static int verbose = 1;
@@ -1121,6 +1122,8 @@ int main(int argc, char **argv)
 
        dev_cnt--;
 
+       crc32c_optimization_init();
+
        /*
         * Open without O_EXCL so that the problem should not occur by the
         * following operation in kernel:
-- 
2.21.0

Reply via email to