Make module tunables cross platform

Adds ZFS_MODULE_PARAM to abstract module parameter
setting to operating systems other than Linux.

Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Reviewed-by: Igor Kozhukhov <igor@dilos.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes #9230
This commit is contained in:
Matthew Macy
2019-09-05 14:49:49 -07:00
committed by Brian Behlendorf
parent 65a91b166e
commit 03fdcb9adc
43 changed files with 544 additions and 660 deletions
+19 -36
View File
@@ -9260,7 +9260,6 @@ spa_event_notify(spa_t *spa, vdev_t *vd, nvlist_t *hist_nvl, const char *name)
spa_event_post(spa_event_create(spa, vd, hist_nvl, name));
}
#if defined(_KERNEL)
/* state manipulation functions */
EXPORT_SYMBOL(spa_open);
EXPORT_SYMBOL(spa_open_rewind);
@@ -9315,57 +9314,41 @@ EXPORT_SYMBOL(spa_prop_clear_bootfs);
/* asynchronous event notification */
EXPORT_SYMBOL(spa_event_notify);
#endif
#if defined(_KERNEL)
/* BEGIN CSTYLED */
module_param(spa_load_verify_shift, int, 0644);
MODULE_PARM_DESC(spa_load_verify_shift, "log2(fraction of arc that can "
"be used by inflight I/Os when verifying pool during import");
/* END CSTYLED */
ZFS_MODULE_PARAM(zfs_spa, spa_, load_verify_shift, INT, ZMOD_RW,
"log2(fraction of arc that can be used by inflight I/Os when "
"verifying pool during import");
module_param(spa_load_verify_metadata, int, 0644);
MODULE_PARM_DESC(spa_load_verify_metadata,
ZFS_MODULE_PARAM(zfs_spa, spa_, load_verify_metadata, INT, ZMOD_RW,
"Set to traverse metadata on pool import");
module_param(spa_load_verify_data, int, 0644);
MODULE_PARM_DESC(spa_load_verify_data,
ZFS_MODULE_PARAM(zfs_spa, spa_, load_verify_data, INT, ZMOD_RW,
"Set to traverse data on pool import");
module_param(spa_load_print_vdev_tree, int, 0644);
MODULE_PARM_DESC(spa_load_print_vdev_tree,
ZFS_MODULE_PARAM(zfs_spa, spa_, load_print_vdev_tree, INT, ZMOD_RW,
"Print vdev tree to zfs_dbgmsg during pool import");
/* CSTYLED */
module_param(zio_taskq_batch_pct, uint, 0444);
MODULE_PARM_DESC(zio_taskq_batch_pct,
ZFS_MODULE_PARAM(zfs_zio, zio_, taskq_batch_pct, UINT, ZMOD_RD,
"Percentage of CPUs to run an IO worker thread");
/* BEGIN CSTYLED */
module_param(zfs_max_missing_tvds, ulong, 0644);
MODULE_PARM_DESC(zfs_max_missing_tvds,
"Allow importing pool with up to this number of missing top-level vdevs"
" (in read-only mode)");
/* END CSTYLED */
ZFS_MODULE_PARAM(zfs, zfs_, max_missing_tvds, ULONG, ZMOD_RW,
"Allow importing pool with up to this number of missing top-level "
"vdevs (in read-only mode)");
module_param(zfs_livelist_condense_zthr_pause, int, 0644);
MODULE_PARM_DESC(zfs_livelist_condense_zthr_pause,
ZFS_MODULE_PARAM(zfs_livelist_condense, zfs_livelist_condense_, zthr_pause, INT, ZMOD_RW,
"Set the livelist condense zthr to pause");
module_param(zfs_livelist_condense_sync_pause, int, 0644);
MODULE_PARM_DESC(zfs_livelist_condense_sync_pause,
ZFS_MODULE_PARAM(zfs_livelist_condense, zfs_livelist_condense_, sync_pause, INT, ZMOD_RW,
"Set the livelist condense synctask to pause");
module_param(zfs_livelist_condense_sync_cancel, int, 0644);
MODULE_PARM_DESC(zfs_livelist_condense_sync_cancel,
ZFS_MODULE_PARAM(zfs_livelist_condense, zfs_livelist_condense_, sync_cancel, INT, ZMOD_RW,
"Whether livelist condensing was canceled in the synctask");
module_param(zfs_livelist_condense_zthr_cancel, int, 0644);
MODULE_PARM_DESC(zfs_livelist_condense_zthr_cancel,
ZFS_MODULE_PARAM(zfs_livelist_condense, zfs_livelist_condense_, zthr_cancel, INT, ZMOD_RW,
"Whether livelist condensing was canceled in the zthr function");
/* BEGIN CSTYLED */
module_param(zfs_livelist_condense_new_alloc, int, 0644);
MODULE_PARM_DESC(zfs_livelist_condense_new_alloc,
"Whether extra ALLOC blkptrs were added to a livelist entry while it"
" was being condensed");
ZFS_MODULE_PARAM(zfs_livelist_condense, zfs_livelist_condense_, new_alloc, INT, ZMOD_RW,
"Whether extra ALLOC blkptrs were added to a livelist entry while it "
"was being condensed");
/* END CSTYLED */
#endif