mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 15:46:17 +07:00
b76377543b
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>
17 lines
453 B
C
17 lines
453 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef _LINUX_CRC_T10DIF_H
|
|
#define _LINUX_CRC_T10DIF_H
|
|
|
|
#include <linux/types.h>
|
|
|
|
#define CRC_T10DIF_DIGEST_SIZE 2
|
|
#define CRC_T10DIF_BLOCK_SIZE 1
|
|
#define CRC_T10DIF_STRING "crct10dif"
|
|
|
|
extern __u16 crc_t10dif_generic(__u16 crc, const unsigned char *buffer,
|
|
size_t len);
|
|
extern __u16 crc_t10dif(unsigned char const *, size_t);
|
|
extern __u16 crc_t10dif_update(__u16 crc, unsigned char const *, size_t);
|
|
|
|
#endif
|