Commit 11dcb103 authored by Martin K. Petersen's avatar Martin K. Petersen Committed by Herbert Xu

crc-t10dif: Allow current transform to be inspected in sysfs

Add a way to print the currently active CRC algorithm in:

	/sys/module/crc_t10dif/parameters/transform
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent b7637754
......@@ -107,6 +107,17 @@ static void __exit crc_t10dif_mod_fini(void)
module_init(crc_t10dif_mod_init);
module_exit(crc_t10dif_mod_fini);
static int crc_t10dif_transform_show(char *buffer, const struct kernel_param *kp)
{
if (static_key_false(&crct10dif_fallback))
return sprintf(buffer, "fallback\n");
return sprintf(buffer, "%s\n",
crypto_tfm_alg_driver_name(crypto_shash_tfm(crct10dif_tfm)));
}
module_param_call(transform, NULL, crc_t10dif_transform_show, NULL, 0644);
MODULE_DESCRIPTION("T10 DIF CRC calculation");
MODULE_LICENSE("GPL");
MODULE_SOFTDEP("pre: crct10dif");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment