From da81d91d48cba656e6ed0c01b38f1cf86ecf1874 Mon Sep 17 00:00:00 2001 From: Ryan Moeller Date: Tue, 1 Sep 2020 19:19:19 -0400 Subject: [PATCH] Make spa_stats.c tunables visible on FreeBSD Use ZFS_MODULE_PARAM for cross-platform tunables in spa_stats.c, and add update tunables.cfg in tests for the newly supported ones. Reviewed-by: Brian Behlendorf Signed-off-by: Ryan Moeller Closes #10858 --- module/zfs/spa_stats.c | 24 +++++++++--------------- tests/zfs-tests/include/tunables.cfg | 4 ++-- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/module/zfs/spa_stats.c b/module/zfs/spa_stats.c index 5c1073c14..cf0be3c45 100644 --- a/module/zfs/spa_stats.c +++ b/module/zfs/spa_stats.c @@ -1028,22 +1028,16 @@ spa_stats_destroy(spa_t *spa) spa_mmp_history_destroy(spa); } -#if defined(_KERNEL) -/* CSTYLED */ -module_param(zfs_read_history, int, 0644); -MODULE_PARM_DESC(zfs_read_history, - "Historical statistics for the last N reads"); +/* BEGIN CSTYLED */ +ZFS_MODULE_PARAM(zfs, zfs_, read_history, INT, ZMOD_RW, + "Historical statistics for the last N reads"); -module_param(zfs_read_history_hits, int, 0644); -MODULE_PARM_DESC(zfs_read_history_hits, - "Include cache hits in read history"); +ZFS_MODULE_PARAM(zfs, zfs_, read_history_hits, INT, ZMOD_RW, + "Include cache hits in read history"); -module_param(zfs_txg_history, int, 0644); -MODULE_PARM_DESC(zfs_txg_history, - "Historical statistics for the last N txgs"); +ZFS_MODULE_PARAM(zfs_txg, zfs_txg_, history, INT, ZMOD_RW, + "Historical statistics for the last N txgs"); -module_param(zfs_multihost_history, int, 0644); -MODULE_PARM_DESC(zfs_multihost_history, - "Historical statistics for last N multihost writes"); +ZFS_MODULE_PARAM(zfs_multihost, zfs_multihost_, history, INT, ZMOD_RW, + "Historical statistics for last N multihost writes"); /* END CSTYLED */ -#endif diff --git a/tests/zfs-tests/include/tunables.cfg b/tests/zfs-tests/include/tunables.cfg index 67a32af1d..ad2811395 100644 --- a/tests/zfs-tests/include/tunables.cfg +++ b/tests/zfs-tests/include/tunables.cfg @@ -54,7 +54,7 @@ MAX_MISSING_TVDS max_missing_tvds zfs_max_missing_tvds METASLAB_DEBUG_LOAD metaslab.debug_load metaslab_debug_load METASLAB_FORCE_GANGING metaslab.force_ganging metaslab_force_ganging MULTIHOST_FAIL_INTERVALS multihost.fail_intervals zfs_multihost_fail_intervals -MULTIHOST_HISTORY UNSUPPORTED zfs_multihost_history +MULTIHOST_HISTORY multihost.history zfs_multihost_history MULTIHOST_IMPORT_INTERVALS multihost.import_intervals zfs_multihost_import_intervals MULTIHOST_INTERVAL multihost.interval zfs_multihost_interval OVERRIDE_ESTIMATE_RECORDSIZE send.override_estimate_recordsize zfs_override_estimate_recordsize @@ -73,7 +73,7 @@ SPA_LOAD_VERIFY_METADATA spa.load_verify_metadata spa_load_verify_metadata TRIM_EXTENT_BYTES_MIN trim.extent_bytes_min zfs_trim_extent_bytes_min TRIM_METASLAB_SKIP trim.metaslab_skip zfs_trim_metaslab_skip TRIM_TXG_BATCH trim.txg_batch zfs_trim_txg_batch -TXG_HISTORY UNSUPPORTED zfs_txg_history +TXG_HISTORY txg.history zfs_txg_history TXG_TIMEOUT txg.timeout zfs_txg_timeout UNLINK_SUSPEND_PROGRESS UNSUPPORTED zfs_unlink_suspend_progress VDEV_MIN_MS_COUNT vdev.min_ms_count zfs_vdev_min_ms_count