File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -75,11 +75,15 @@ BLAKE2b 14500 34 builtin, reference impl.
7575======== ============ ======= ================================
7676
7777Many kernels are configured with SHA256 as built-in and not as a module.
78- The accelerated versions are however provided by the modules and must be loaded
78+ Up to kernel v6.15 the accelerated versions are however provided by the
79+ modules and must be loaded
7980explicitly (:command: `modprobe sha256 `) before mounting the filesystem to make use of
8081them. You can check in :file: `/sys/fs/btrfs/FSID/checksum ` which one is used. If you
8182see *sha256-generic *, then you may want to unmount and mount the filesystem
8283again. Changing that on a mounted filesystem is not possible.
84+
85+ Since kernel v6.16 the accelereated implementation is always used if available.
86+
8387Check the file :file: `/proc/crypto `, when the implementation is built-in, you'd find:
8488
8589.. code-block :: none
Original file line number Diff line number Diff line change 2929#include <pthread.h>
3030#include <uuid/uuid.h>
3131#include <blkid/blkid.h>
32+ #include <linux/version.h>
3233#include "kernel-lib/list.h"
3334#include "kernel-lib/list_sort.h"
3435#include "kernel-lib/rbtree.h"
@@ -2410,10 +2411,14 @@ int BOX_MAIN(mkfs)(int argc, char **argv)
24102411 list_all_devices (root , opt_zoned );
24112412
24122413 if (mkfs_cfg .csum_type == BTRFS_CSUM_TYPE_SHA256 ) {
2413- printf (
2414- "NOTE: you may need to manually load kernel module implementing accelerated SHA256 in case\n"
2414+ u32 kernel_version = get_running_kernel_version ();
2415+
2416+ if (kernel_version < KERNEL_VERSION (6 ,16 ,0 )) {
2417+ printf (
2418+ "NOTE: in kernels < v6.16 you may need to manually load kernel module implementing accelerated SHA256 in case\n"
24152419" the generic implementation is built-in, before mount. Check lsmod or /proc/crypto\n\n"
2416- );
2420+ );
2421+ }
24172422 }
24182423 }
24192424
You can’t perform that action at this time.
0 commit comments