mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
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 <allanjude@freebsd.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Olaf Faaland <faaland1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #9964
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user