summaryrefslogtreecommitdiffstats
path: root/module/os
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-02-10 16:11:30 -0500
committerGitHub <[email protected]>2020-02-10 13:11:30 -0800
commit57940b435cd1dab6529babcda095c47ecee8a8e9 (patch)
tree49a16dceaf58e2350636ecd335209b21846ff3ef /module/os
parent572b5b302a8353814f8631085fcdb7623698b191 (diff)
Share some code for spa deadman tunables
We need to do the same thing to update all spas on any OS for these tunables, so let's share the code. While here let's match the types of the literals initializing the variables with the type of the variable. Reviewed-by: Allan Jude <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Olaf Faaland <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #9964
Diffstat (limited to 'module/os')
-rw-r--r--module/os/linux/zfs/spa_misc_os.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/module/os/linux/zfs/spa_misc_os.c b/module/os/linux/zfs/spa_misc_os.c
index 33ff6c082..85de10d40 100644
--- a/module/os/linux/zfs/spa_misc_os.c
+++ b/module/os/linux/zfs/spa_misc_os.c
@@ -58,20 +58,13 @@ param_set_deadman_failmode(const char *val, zfs_kernel_param_t *kp)
int
param_set_deadman_ziotime(const char *val, zfs_kernel_param_t *kp)
{
- spa_t *spa = NULL;
int error;
error = param_set_ulong(val, kp);
if (error < 0)
return (SET_ERROR(error));
- if (spa_mode_global != SPA_MODE_UNINIT) {
- mutex_enter(&spa_namespace_lock);
- while ((spa = spa_next(spa)) != NULL)
- spa->spa_deadman_ziotime =
- MSEC2NSEC(zfs_deadman_ziotime_ms);
- mutex_exit(&spa_namespace_lock);
- }
+ spa_set_deadman_ziotime(MSEC2NSEC(zfs_deadman_ziotime_ms));
return (0);
}
@@ -79,20 +72,13 @@ param_set_deadman_ziotime(const char *val, zfs_kernel_param_t *kp)
int
param_set_deadman_synctime(const char *val, zfs_kernel_param_t *kp)
{
- spa_t *spa = NULL;
int error;
error = param_set_ulong(val, kp);
if (error < 0)
return (SET_ERROR(error));
- if (spa_mode_global != SPA_MODE_UNINIT) {
- mutex_enter(&spa_namespace_lock);
- while ((spa = spa_next(spa)) != NULL)
- spa->spa_deadman_synctime =
- MSEC2NSEC(zfs_deadman_synctime_ms);
- mutex_exit(&spa_namespace_lock);
- }
+ spa_set_deadman_synctime(MSEC2NSEC(zfs_deadman_synctime_ms));
return (0);
}