aboutsummaryrefslogtreecommitdiffstats
path: root/module/zfs/spa_misc.c
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-12-05 12:40:45 -0800
committerBrian Behlendorf <[email protected]>2019-12-05 12:40:45 -0800
commite64e84eca57966cff1314d61f5b9557876e856e3 (patch)
treea436377c9184fb2be46f1286a29edf943a94f264 /module/zfs/spa_misc.c
parent2a8ba608d3eace43010174aa4f67c8b8af4aacf3 (diff)
Refactor deadman set failmode to be cross platform
Update zfs_deadman_failmode to use the ZFS_MODULE_PARAM_CALL wrapper, and split the common and platform specific portions. Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9670
Diffstat (limited to 'module/zfs/spa_misc.c')
-rw-r--r--module/zfs/spa_misc.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/module/zfs/spa_misc.c b/module/zfs/spa_misc.c
index d49c92e20..fe086d7b3 100644
--- a/module/zfs/spa_misc.c
+++ b/module/zfs/spa_misc.c
@@ -2708,21 +2708,21 @@ spa_suspend_async_destroy(spa_t *spa)
#if defined(_KERNEL)
-static int
-param_set_deadman_failmode(const char *val, zfs_kernel_param_t *kp)
+int
+param_set_deadman_failmode_common(const char *val)
{
spa_t *spa = NULL;
char *p;
if (val == NULL)
- return (SET_ERROR(-EINVAL));
+ return (SET_ERROR(EINVAL));
if ((p = strchr(val, '\n')) != NULL)
*p = '\0';
if (strcmp(val, "wait") != 0 && strcmp(val, "continue") != 0 &&
strcmp(val, "panic"))
- return (SET_ERROR(-EINVAL));
+ return (SET_ERROR(EINVAL));
if (spa_mode_global != SPA_MODE_UNINIT) {
mutex_enter(&spa_namespace_lock);
@@ -2731,7 +2731,7 @@ param_set_deadman_failmode(const char *val, zfs_kernel_param_t *kp)
mutex_exit(&spa_namespace_lock);
}
- return (param_set_charp(val, kp));
+ return (0);
}
#endif
@@ -2847,13 +2847,11 @@ ZFS_MODULE_PARAM(zfs, zfs_, ddt_data_is_special, INT, ZMOD_RW,
ZFS_MODULE_PARAM(zfs, zfs_, user_indirect_is_special, INT, ZMOD_RW,
"Place user data indirect blocks into the special class");
-#ifdef _KERNEL
-module_param_call(zfs_deadman_failmode, param_set_deadman_failmode,
- param_get_charp, &zfs_deadman_failmode, 0644);
-MODULE_PARM_DESC(zfs_deadman_failmode, "Failmode for deadman timer");
-#endif
-
/* BEGIN CSTYLED */
+ZFS_MODULE_PARAM_CALL(zfs_deadman, zfs_deadman_, failmode,
+ param_set_deadman_failmode, param_get_charp, ZMOD_RW,
+ "Failmode for deadman timer");
+
ZFS_MODULE_PARAM_CALL(zfs_deadman, zfs_deadman_, synctime_ms,
param_set_deadman_synctime, param_get_ulong, ZMOD_RW,
"Pool sync expiration time in milliseconds");