Skip to content

Commit

Permalink
Refactor deadman set failmode to be cross platform
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Macy <[email protected]>
  • Loading branch information
mattmacy committed Dec 3, 2019
1 parent 54c8366 commit 9474c08
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions include/sys/spa.h
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,7 @@ extern void spa_wake_waiters(spa_t *spa);
int 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);
int param_set_slop_shift(const char *buf, zfs_kernel_param_t *kp);
int param_set_deadman_failmode(const char *val, zfs_kernel_param_t *kp);

#ifdef ZFS_DEBUG
#define dprintf_bp(bp, fmt, ...) do { \
Expand Down
11 changes: 11 additions & 0 deletions module/os/linux/zfs/spa_misc_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@
#include <sys/kstat.h>
#include "zfs_prop.h"


int
param_set_deadman_failmode(const char *val, zfs_kernel_param_t *kp)
{
int error;

error = param_set_deadman_failmode_common(val);

return (error || param_set_charp(val, kp));
}

int
param_set_deadman_ziotime(const char *val, zfs_kernel_param_t *kp)
{
Expand Down
6 changes: 3 additions & 3 deletions module/zfs/spa_misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2708,8 +2708,8 @@ 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;
Expand All @@ -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

Expand Down

0 comments on commit 9474c08

Please sign in to comment.