From 03fdcb9adc596fb86a65edb56d8088b77ea2d891 Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Thu, 5 Sep 2019 14:49:49 -0700 Subject: Make module tunables cross platform Adds ZFS_MODULE_PARAM to abstract module parameter setting to operating systems other than Linux. Reviewed-by: Jorgen Lundman Reviewed-by: Igor Kozhukhov Reviewed-by: Brian Behlendorf Signed-off-by: Matt Macy Signed-off-by: Ryan Moeller Closes #9230 --- module/zfs/spa_config.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'module/zfs/spa_config.c') diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c index 6c0894338..43da79dc3 100644 --- a/module/zfs/spa_config.c +++ b/module/zfs/spa_config.c @@ -611,17 +611,19 @@ spa_config_update(spa_t *spa, int what) spa_config_update(spa, SPA_CONFIG_UPDATE_VDEVS); } -#if defined(_KERNEL) EXPORT_SYMBOL(spa_config_load); EXPORT_SYMBOL(spa_all_configs); EXPORT_SYMBOL(spa_config_set); EXPORT_SYMBOL(spa_config_generate); EXPORT_SYMBOL(spa_config_update); -module_param(spa_config_path, charp, 0444); -MODULE_PARM_DESC(spa_config_path, "SPA config file (/etc/zfs/zpool.cache)"); - -module_param(zfs_autoimport_disable, int, 0644); -MODULE_PARM_DESC(zfs_autoimport_disable, "Disable pool import at module load"); - +/* BEGIN CSTYLED */ +#ifdef __linux__ +/* string sysctls require a char array on FreeBSD */ +ZFS_MODULE_PARAM(zfs_spa, spa_, config_path, STRING, ZMOD_RD, + "SPA config file (/etc/zfs/zpool.cache)"); #endif + +ZFS_MODULE_PARAM(zfs, zfs_, autoimport_disable, INT, ZMOD_RW, + "Disable pool import at module load"); +/* END CSTYLED */ -- cgit v1.2.3