mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-27 04:32:16 +03:00
Fix memory allocation issue for BLAKE3 context
The kmem_alloc(sizeof (*ctx), KM_NOSLEEP) call on FreeBSD can't be used in this code segment. Work around this by pre-allocating a percpu context array for later use. Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Tino Reichardt <milky-zfs@mcmilk.de> Closes #13568
This commit is contained in:
@@ -277,6 +277,9 @@ chksum_benchmark(void)
|
||||
void
|
||||
chksum_init(void)
|
||||
{
|
||||
#ifdef _KERNEL
|
||||
blake3_per_cpu_ctx_init();
|
||||
#endif
|
||||
|
||||
/* Benchmark supported implementations */
|
||||
chksum_benchmark();
|
||||
@@ -313,4 +316,8 @@ chksum_fini(void)
|
||||
chksum_stat_cnt = 0;
|
||||
chksum_stat_data = 0;
|
||||
}
|
||||
|
||||
#ifdef _KERNEL
|
||||
blake3_per_cpu_ctx_fini();
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user