btrfs-progs: Enable crc32 optimization probe for convert and mkfs
PATCH 1/1 btrfs-progs: Enable crc32 optimization probe for convert and mkfs
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 <[email protected]>
--- convert/main.c | 2 ++ mkfs/main.c | 3 +++ 2 files changed, 5 insertions(+)
convert/main.c +2 -0
@@ -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 {
mkfs/main.c +3 -0
@@ -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:
Signature · 1 line
2.21.0
Quoted 3 lines · Qu Wenruo
Although moderm hardware is fast enough and crc32 calculation is not a hotspot, doing such optimization won't hurt anyway.
If there is a bug report, please reference it in the commit. I use the following format for github issues
Issue: #1234
as this will add an notification to the issue when the patch is pushed to some branch.
Patch added to devel, thanks.