From d490933d1493eacd32f520f2d71bd2ec8c8f5df9 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Mon, 27 May 2019 12:46:27 +0800 Subject: [PATCH] btrfs-progs: Enable crc32c optimization probe for convert and mkfs Although moderm hardware is fast enough and crc32c calculation is not a hotspot, doing such optimization won't hurt anyway. Issue: #175 Signed-off-by: Qu Wenruo Signed-off-by: David Sterba --- convert/main.c | 3 +++ mkfs/main.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/convert/main.c b/convert/main.c index 68f76f71..01090b98 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; @@ -1727,6 +1728,8 @@ int main(int argc, char *argv[]) char fslabel[BTRFS_LABEL_SIZE]; u64 features = BTRFS_MKFS_DEFAULT_FEATURES; + crc32c_optimization_init(); + while(1) { enum { GETOPT_VAL_NO_PROGRESS = 256 }; static const struct option long_options[] = { diff --git a/mkfs/main.c b/mkfs/main.c index b442e6e4..6b47a9ee 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; @@ -811,6 +812,8 @@ int main(int argc, char **argv) struct mkfs_allocation allocation = { 0 }; struct btrfs_mkfs_config mkfs_cfg; + crc32c_optimization_init(); + while(1) { int c; enum { GETOPT_VAL_SHRINK = 257 };