1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or https://opensource.org/licenses/CDDL-1.0.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
23  * Copyright (c) 2011, 2019 by Delphix. All rights reserved.
24  * Copyright 2015 Nexenta Systems, Inc.  All rights reserved.
25  * Copyright (c) 2014 Spectra Logic Corporation, All rights reserved.
26  * Copyright 2013 Saso Kiselkov. All rights reserved.
27  * Copyright (c) 2017 Datto Inc.
28  * Copyright (c) 2017, Intel Corporation.
29  */
30 
31 #include <sys/zfs_context.h>
32 #include <sys/spa_impl.h>
33 #include <sys/spa.h>
34 #include <sys/txg.h>
35 #include <sys/unique.h>
36 #include <sys/dsl_pool.h>
37 #include <sys/dsl_dir.h>
38 #include <sys/dsl_prop.h>
39 #include <sys/fm/util.h>
40 #include <sys/dsl_scan.h>
41 #include <sys/fs/zfs.h>
42 #include <sys/kstat.h>
43 #include "zfs_prop.h"
44 
45 
46 int
47 param_set_deadman_failmode(const char *val, zfs_kernel_param_t *kp)
48 {
49 	int error;
50 
51 	error = -param_set_deadman_failmode_common(val);
52 	if (error == 0)
53 		error = param_set_charp(val, kp);
54 
55 	return (error);
56 }
57 
58 int
59 param_set_deadman_ziotime(const char *val, zfs_kernel_param_t *kp)
60 {
61 	int error;
62 
63 	error = spl_param_set_u64(val, kp);
64 	if (error < 0)
65 		return (SET_ERROR(error));
66 
67 	spa_set_deadman_ziotime(MSEC2NSEC(zfs_deadman_ziotime_ms));
68 
69 	return (0);
70 }
71 
72 int
73 param_set_deadman_synctime(const char *val, zfs_kernel_param_t *kp)
74 {
75 	int error;
76 
77 	error = spl_param_set_u64(val, kp);
78 	if (error < 0)
79 		return (SET_ERROR(error));
80 
81 	spa_set_deadman_synctime(MSEC2NSEC(zfs_deadman_synctime_ms));
82 
83 	return (0);
84 }
85 
86 int
87 param_set_slop_shift(const char *buf, zfs_kernel_param_t *kp)
88 {
89 	unsigned long val;
90 	int error;
91 
92 	error = kstrtoul(buf, 0, &val);
93 	if (error)
94 		return (SET_ERROR(error));
95 
96 	if (val < 1 || val > 31)
97 		return (SET_ERROR(-EINVAL));
98 
99 	error = param_set_int(buf, kp);
100 	if (error < 0)
101 		return (SET_ERROR(error));
102 
103 	return (0);
104 }
105 
106 int
107 param_set_active_allocator(const char *val, zfs_kernel_param_t *kp)
108 {
109 	int error;
110 
111 	error = -param_set_active_allocator_common(val);
112 	if (error == 0)
113 		error = param_set_charp(val, kp);
114 
115 	return (error);
116 }
117 
118 const char *
119 spa_history_zone(void)
120 {
121 	return ("linux");
122 }
123 
124 void
125 spa_import_os(spa_t *spa)
126 {
127 	(void) spa;
128 }
129 
130 void
131 spa_export_os(spa_t *spa)
132 {
133 	(void) spa;
134 }
135 
136 void
137 spa_activate_os(spa_t *spa)
138 {
139 	(void) spa;
140 }
141 
142 void
143 spa_deactivate_os(spa_t *spa)
144 {
145 	(void) spa;
146 }
147