FreeBSD: Implement sysctl for fletcher4 impl

There is a tunable to select the fletcher 4 checksum implementation on
Linux but it was not present in FreeBSD.

Implement the sysctl handler for FreeBSD and use ZFS_MODULE_PARAM_CALL
to provide the tunable on both platforms.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@iXsystems.com>
Closes #11270
This commit is contained in:
Ryan Moeller
2020-12-02 21:45:08 +00:00
committed by Brian Behlendorf
parent ba67d82142
commit 439dc034e9
3 changed files with 75 additions and 8 deletions
@@ -144,6 +144,17 @@ enum scope_prefix_types {
MODULE_PARM_DESC(name_prefix ## name, desc)
/* END CSTYLED */
/*
* As above, but there is no variable with the name name_prefix ## name,
* so NULL is passed to module_param_call instead.
*/
/* BEGIN CSTYLED */
#define ZFS_MODULE_VIRTUAL_PARAM_CALL(scope_prefix, name_prefix, name, setfunc, getfunc, perm, desc) \
CTASSERT_GLOBAL((sizeof (scope_prefix) == sizeof (enum scope_prefix_types))); \
module_param_call(name_prefix ## name, setfunc, getfunc, NULL, perm); \
MODULE_PARM_DESC(name_prefix ## name, desc)
/* END CSTYLED */
#define ZFS_MODULE_PARAM_ARGS const char *buf, zfs_kernel_param_t *kp
#define ZFS_MODULE_DESCRIPTION(s) MODULE_DESCRIPTION(s)