Fix O_APPEND for Linux 3.15 and older kernels
[zfs.git] / module / os / linux / zfs / spa_misc_os.c
blobcbdc0f350ad89a090937d081dd76d4f185d6d1fc
1 /*
2 * CDDL HEADER START
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.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
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]
19 * CDDL HEADER END
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.
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"
46 int
47 param_set_deadman_failmode(const char *val, zfs_kernel_param_t *kp)
49 int error;
51 error = -param_set_deadman_failmode_common(val);
52 if (error == 0)
53 error = param_set_charp(val, kp);
55 return (error);
58 int
59 param_set_deadman_ziotime(const char *val, zfs_kernel_param_t *kp)
61 int error;
63 error = param_set_ulong(val, kp);
64 if (error < 0)
65 return (SET_ERROR(error));
67 spa_set_deadman_ziotime(MSEC2NSEC(zfs_deadman_ziotime_ms));
69 return (0);
72 int
73 param_set_deadman_synctime(const char *val, zfs_kernel_param_t *kp)
75 int error;
77 error = param_set_ulong(val, kp);
78 if (error < 0)
79 return (SET_ERROR(error));
81 spa_set_deadman_synctime(MSEC2NSEC(zfs_deadman_synctime_ms));
83 return (0);
86 int
87 param_set_slop_shift(const char *buf, zfs_kernel_param_t *kp)
89 unsigned long val;
90 int error;
92 error = kstrtoul(buf, 0, &val);
93 if (error)
94 return (SET_ERROR(error));
96 if (val < 1 || val > 31)
97 return (SET_ERROR(-EINVAL));
99 error = param_set_int(buf, kp);
100 if (error < 0)
101 return (SET_ERROR(error));
103 return (0);
106 const char *
107 spa_history_zone(void)
109 return ("linux");
112 void
113 spa_import_os(spa_t *spa)
115 (void) spa;
118 void
119 spa_export_os(spa_t *spa)
121 (void) spa;
124 void
125 spa_activate_os(spa_t *spa)
127 (void) spa;
130 void
131 spa_deactivate_os(spa_t *spa)
133 (void) spa;