]> git.baikalelectronics.ru Git - kernel.git/commit
crc-t10dif: Pick better transform if one becomes available
authorMartin K. Petersen <martin.petersen@oracle.com>
Thu, 30 Aug 2018 15:00:15 +0000 (11:00 -0400)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 4 Sep 2018 03:37:05 +0000 (11:37 +0800)
commit58d84c0ee6ba46278bf3bda83daf8a6b3d7859d3
tree8d5d0c7b6ab09eda6a51f2e65fcfc459895e2c92
parent6a85ed6323c5e79a3568bdb16f7cd937c89b5d1e
crc-t10dif: Pick better transform if one becomes available

T10 CRC library is linked into the kernel thanks to block and SCSI. The
crypto accelerators are typically loaded later as modules and are
therefore not available when the T10 CRC library is initialized.

Use the crypto notifier facility to trigger a switch to a better algorithm
if one becomes available after the initial hash has been registered. Use
RCU to protect the original transform while the new one is being set up.

Suggested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org
Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
include/linux/crc-t10dif.h
lib/crc-t10dif.c