mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 11:19:32 +03:00
Move linux specific mmp module_param_call handler to platform code
Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #9465
This commit is contained in:
parent
cf2eba666e
commit
0e939e434a
@ -10,6 +10,7 @@ endif
|
||||
ccflags-y += -I@abs_top_srcdir@/module/os/linux/zfs
|
||||
|
||||
$(MODULE)-objs += ../os/linux/zfs/abd.o
|
||||
$(MODULE)-objs += ../os/linux/zfs/mmp_os.o
|
||||
$(MODULE)-objs += ../os/linux/zfs/policy.o
|
||||
$(MODULE)-objs += ../os/linux/zfs/trace.o
|
||||
$(MODULE)-objs += ../os/linux/zfs/qat.o
|
||||
|
46
module/os/linux/zfs/mmp_os.c
Normal file
46
module/os/linux/zfs/mmp_os.c
Normal file
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* CDDL HEADER START
|
||||
*
|
||||
* The contents of this file are subject to the terms of the
|
||||
* Common Development and Distribution License (the "License").
|
||||
* You may not use this file except in compliance with the License.
|
||||
*
|
||||
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
|
||||
* or http://www.opensolaris.org/os/licensing.
|
||||
* See the License for the specific language governing permissions
|
||||
* and limitations under the License.
|
||||
*
|
||||
* When distributing Covered Code, include this CDDL HEADER in each
|
||||
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
||||
* If applicable, add the following below this CDDL HEADER, with the
|
||||
* fields enclosed by brackets "[]" replaced with your own identifying
|
||||
* information: Portions Copyright [yyyy] [name of copyright owner]
|
||||
*
|
||||
* CDDL HEADER END
|
||||
*/
|
||||
/*
|
||||
* Copyright (c) 2017 by Lawrence Livermore National Security, LLC.
|
||||
*/
|
||||
|
||||
#include <sys/zfs_context.h>
|
||||
#include <sys/mmp.h>
|
||||
|
||||
static int
|
||||
param_set_multihost_interval(const char *val, zfs_kernel_param_t *kp)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = param_set_ulong(val, kp);
|
||||
if (ret < 0)
|
||||
return (ret);
|
||||
|
||||
if (spa_mode_global != 0)
|
||||
mmp_signal_all_threads();
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
module_param_call(zfs_multihost_interval, param_set_multihost_interval,
|
||||
param_get_ulong, &zfs_multihost_interval, 0644);
|
||||
MODULE_PARM_DESC(zfs_multihost_interval,
|
||||
"Milliseconds between mmp writes to each leaf");
|
@ -716,36 +716,8 @@ mmp_signal_all_threads(void)
|
||||
mutex_exit(&spa_namespace_lock);
|
||||
}
|
||||
|
||||
#if defined(_KERNEL)
|
||||
|
||||
static int
|
||||
param_set_multihost_interval(const char *val, zfs_kernel_param_t *kp)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = param_set_ulong(val, kp);
|
||||
if (ret < 0)
|
||||
return (ret);
|
||||
|
||||
if (spa_mode_global != 0)
|
||||
mmp_signal_all_threads();
|
||||
|
||||
return (ret);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
/* BEGIN CSTYLED */
|
||||
#if defined(_KERNEL)
|
||||
module_param_call(zfs_multihost_interval, param_set_multihost_interval,
|
||||
param_get_ulong, &zfs_multihost_interval, 0644);
|
||||
MODULE_PARM_DESC(zfs_multihost_interval,
|
||||
"Milliseconds between mmp writes to each leaf");
|
||||
#endif
|
||||
|
||||
ZFS_MODULE_PARAM(zfs_multihost, zfs_multihost_, fail_intervals, UINT, ZMOD_RW,
|
||||
"Max allowed period without a successful mmp write");
|
||||
|
||||
ZFS_MODULE_PARAM(zfs_multihost, zfs_multihost_, import_intervals, UINT, ZMOD_RW,
|
||||
"Number of zfs_multihost_interval periods to wait for activity");
|
||||
/* END CSTYLED */
|
||||
|
Loading…
Reference in New Issue
Block a user