aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am2
-rw-r--r--include/linux/Makefile.am3
-rw-r--r--include/linux/blkdev_compat.h1
-rw-r--r--include/linux/compiler_compat.h35
-rw-r--r--include/spl/Makefile.am1
-rw-r--r--include/spl/rpc/Makefile.am7
-rw-r--r--include/spl/sys/Makefile.am61
-rw-r--r--include/spl/sys/debug.h2
-rw-r--r--include/spl/sys/errno.h47
-rw-r--r--include/spl/sys/mutex.h3
-rw-r--r--include/spl/sys/rwlock.h1
-rw-r--r--include/spl/sys/sysmacros.h1
-rw-r--r--include/spl/sys/types.h4
-rw-r--r--include/spl/sys/vnode.h4
-rw-r--r--include/sys/Makefile.am1
-rw-r--r--include/sys/abd.h3
-rw-r--r--include/sys/fm/protocol.h1
-rw-r--r--include/sys/note.h56
-rw-r--r--include/sys/nvpair.h7
-rw-r--r--include/sys/xvattr.h1
-rw-r--r--include/sys/zfs_context.h14
-rw-r--r--include/sys/zfs_delay.h2
-rw-r--r--include/sys/zfs_fuid.h1
-rw-r--r--include/sys/zfs_znode.h1
-rw-r--r--include/sys/zpl.h1
25 files changed, 226 insertions, 34 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index 23e15dac4..5f13505f2 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = linux sys
+SUBDIRS = linux spl sys
COMMON_H = \
$(top_srcdir)/include/zfeature_common.h \
diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am
index 89c2689f6..efb49520e 100644
--- a/include/linux/Makefile.am
+++ b/include/linux/Makefile.am
@@ -10,7 +10,8 @@ KERNEL_H = \
$(top_srcdir)/include/linux/simd_x86.h \
$(top_srcdir)/include/linux/simd_aarch64.h \
$(top_srcdir)/include/linux/mod_compat.h \
- $(top_srcdir)/include/linux/page_compat.h
+ $(top_srcdir)/include/linux/page_compat.h \
+ $(top_srcdir)/include/linux/compiler_compat.h
USER_H =
diff --git a/include/linux/blkdev_compat.h b/include/linux/blkdev_compat.h
index f99980ab3..c42cdd37a 100644
--- a/include/linux/blkdev_compat.h
+++ b/include/linux/blkdev_compat.h
@@ -32,6 +32,7 @@
#include <linux/blkdev.h>
#include <linux/elevator.h>
#include <linux/backing-dev.h>
+#include <linux/hdreg.h>
#ifndef HAVE_FMODE_T
typedef unsigned __bitwise__ fmode_t;
diff --git a/include/linux/compiler_compat.h b/include/linux/compiler_compat.h
new file mode 100644
index 000000000..921d32f24
--- /dev/null
+++ b/include/linux/compiler_compat.h
@@ -0,0 +1,35 @@
+/*
+ * 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) 2018 Lawrence Livermore National Security, LLC.
+ */
+
+#ifndef _ZFS_COMPILER_COMPAT_H
+#define _ZFS_COMPILER_COMPAT_H
+
+#include <linux/compiler.h>
+
+#if !defined(READ_ONCE)
+#define READ_ONCE(x) ACCESS_ONCE(x)
+#endif
+
+#endif /* _ZFS_COMPILER_COMPAT_H */
diff --git a/include/spl/Makefile.am b/include/spl/Makefile.am
new file mode 100644
index 000000000..bd781c08f
--- /dev/null
+++ b/include/spl/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = rpc sys
diff --git a/include/spl/rpc/Makefile.am b/include/spl/rpc/Makefile.am
new file mode 100644
index 000000000..5110cc0f0
--- /dev/null
+++ b/include/spl/rpc/Makefile.am
@@ -0,0 +1,7 @@
+KERNEL_H = \
+ $(top_srcdir)/include/spl/rpc/xdr.h
+
+if CONFIG_KERNEL
+kerneldir = @prefix@/src/zfs-$(VERSION)/include/spl/rpc
+kernel_HEADERS = $(KERNEL_H)
+endif
diff --git a/include/spl/sys/Makefile.am b/include/spl/sys/Makefile.am
new file mode 100644
index 000000000..d58ed0e20
--- /dev/null
+++ b/include/spl/sys/Makefile.am
@@ -0,0 +1,61 @@
+KERNEL_H = \
+ $(top_srcdir)/include/spl/sys/acl.h \
+ $(top_srcdir)/include/spl/sys/atomic.h \
+ $(top_srcdir)/include/spl/sys/byteorder.h \
+ $(top_srcdir)/include/spl/sys/callb.h \
+ $(top_srcdir)/include/spl/sys/callo.h \
+ $(top_srcdir)/include/spl/sys/cmn_err.h \
+ $(top_srcdir)/include/spl/sys/condvar.h \
+ $(top_srcdir)/include/spl/sys/console.h \
+ $(top_srcdir)/include/spl/sys/cred.h \
+ $(top_srcdir)/include/spl/sys/ctype.h \
+ $(top_srcdir)/include/spl/sys/debug.h \
+ $(top_srcdir)/include/spl/sys/disp.h \
+ $(top_srcdir)/include/spl/sys/dkioc_free_util.h \
+ $(top_srcdir)/include/spl/sys/dkio.h \
+ $(top_srcdir)/include/spl/sys/errno.h \
+ $(top_srcdir)/include/spl/sys/fcntl.h \
+ $(top_srcdir)/include/spl/sys/file.h \
+ $(top_srcdir)/include/spl/sys/inttypes.h \
+ $(top_srcdir)/include/spl/sys/isa_defs.h \
+ $(top_srcdir)/include/spl/sys/kmem_cache.h \
+ $(top_srcdir)/include/spl/sys/kmem.h \
+ $(top_srcdir)/include/spl/sys/kobj.h \
+ $(top_srcdir)/include/spl/sys/kstat.h \
+ $(top_srcdir)/include/spl/sys/list.h \
+ $(top_srcdir)/include/spl/sys/mode.h \
+ $(top_srcdir)/include/spl/sys/mutex.h \
+ $(top_srcdir)/include/spl/sys/param.h \
+ $(top_srcdir)/include/spl/sys/processor.h \
+ $(top_srcdir)/include/spl/sys/proc.h \
+ $(top_srcdir)/include/spl/sys/random.h \
+ $(top_srcdir)/include/spl/sys/rwlock.h \
+ $(top_srcdir)/include/spl/sys/shrinker.h \
+ $(top_srcdir)/include/spl/sys/sid.h \
+ $(top_srcdir)/include/spl/sys/signal.h \
+ $(top_srcdir)/include/spl/sys/stat.h \
+ $(top_srcdir)/include/spl/sys/strings.h \
+ $(top_srcdir)/include/spl/sys/sunddi.h \
+ $(top_srcdir)/include/spl/sys/sysmacros.h \
+ $(top_srcdir)/include/spl/sys/systeminfo.h \
+ $(top_srcdir)/include/spl/sys/taskq.h \
+ $(top_srcdir)/include/spl/sys/thread.h \
+ $(top_srcdir)/include/spl/sys/time.h \
+ $(top_srcdir)/include/spl/sys/timer.h \
+ $(top_srcdir)/include/spl/sys/tsd.h \
+ $(top_srcdir)/include/spl/sys/types32.h \
+ $(top_srcdir)/include/spl/sys/types.h \
+ $(top_srcdir)/include/spl/sys/uio.h \
+ $(top_srcdir)/include/spl/sys/user.h \
+ $(top_srcdir)/include/spl/sys/vfs.h \
+ $(top_srcdir)/include/spl/sys/vmem.h \
+ $(top_srcdir)/include/spl/sys/vmsystm.h \
+ $(top_srcdir)/include/spl/sys/vnode.h \
+ $(top_srcdir)/include/spl/sys/wait.h \
+ $(top_srcdir)/include/spl/sys/zmod.h \
+ $(top_srcdir)/include/spl/sys/zone.h
+
+if CONFIG_KERNEL
+kerneldir = @prefix@/src/zfs-$(VERSION)/include/spl/sys
+kernel_HEADERS = $(KERNEL_H)
+endif
diff --git a/include/spl/sys/debug.h b/include/spl/sys/debug.h
index a4a458066..692d6c61e 100644
--- a/include/spl/sys/debug.h
+++ b/include/spl/sys/debug.h
@@ -92,7 +92,6 @@ void spl_dumpstack(void);
*/
#ifdef NDEBUG
-#define SPL_DEBUG_STR ""
#define ASSERT(x) ((void)0)
#define ASSERTV(x)
#define ASSERT3B(x,y,z) ((void)0)
@@ -108,7 +107,6 @@ void spl_dumpstack(void);
*/
#else
-#define SPL_DEBUG_STR " (DEBUG mode)"
#define ASSERT(cond) VERIFY(cond)
#define ASSERTV(x) x
#define ASSERT3B(x,y,z) VERIFY3B(x, y, z)
diff --git a/include/spl/sys/errno.h b/include/spl/sys/errno.h
new file mode 100644
index 000000000..6015b1a3e
--- /dev/null
+++ b/include/spl/sys/errno.h
@@ -0,0 +1,47 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (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 2000 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
+/* All Rights Reserved */
+
+/*
+ * University Copyright- Copyright (c) 1982, 1986, 1988
+ * The Regents of the University of California
+ * All Rights Reserved
+ *
+ * University Acknowledgment- Portions of this document are derived from
+ * software developed by the University of California, Berkeley, and its
+ * contributors.
+ */
+
+#ifndef _SYS_ERRNO_H
+#define _SYS_ERRNO_H
+
+#include <linux/errno.h>
+
+#define ENOTSUP EOPNOTSUPP
+
+#endif /* _SYS_ERRNO_H */
diff --git a/include/spl/sys/mutex.h b/include/spl/sys/mutex.h
index f906d49d4..ed0cd4932 100644
--- a/include/spl/sys/mutex.h
+++ b/include/spl/sys/mutex.h
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <linux/mutex.h>
#include <linux/lockdep.h>
+#include <linux/compiler_compat.h>
typedef enum {
MUTEX_DEFAULT = 0,
@@ -59,7 +60,7 @@ spl_mutex_clear_owner(kmutex_t *mp)
mp->m_owner = NULL;
}
-#define mutex_owner(mp) (ACCESS_ONCE((mp)->m_owner))
+#define mutex_owner(mp) (READ_ONCE((mp)->m_owner))
#define mutex_owned(mp) (mutex_owner(mp) == current)
#define MUTEX_HELD(mp) mutex_owned(mp)
#define MUTEX_NOT_HELD(mp) (!MUTEX_HELD(mp))
diff --git a/include/spl/sys/rwlock.h b/include/spl/sys/rwlock.h
index b44ceab66..088e28b44 100644
--- a/include/spl/sys/rwlock.h
+++ b/include/spl/sys/rwlock.h
@@ -27,6 +27,7 @@
#include <sys/types.h>
#include <linux/rwsem.h>
+#include <linux/sched.h>
/* Linux kernel compatibility */
#if defined(CONFIG_PREEMPT_RT_FULL)
diff --git a/include/spl/sys/sysmacros.h b/include/spl/sys/sysmacros.h
index 839e7fd8c..e4bd80aa1 100644
--- a/include/spl/sys/sysmacros.h
+++ b/include/spl/sys/sysmacros.h
@@ -79,7 +79,6 @@
#define max_ncpus num_possible_cpus()
#define boot_ncpus num_online_cpus()
#define CPU_SEQID smp_processor_id()
-#define _NOTE(x)
#define is_system_labeled() 0
#ifndef RLIM64_INFINITY
diff --git a/include/spl/sys/types.h b/include/spl/sys/types.h
index a5b478127..3bb3ed3e2 100644
--- a/include/spl/sys/types.h
+++ b/include/spl/sys/types.h
@@ -28,11 +28,11 @@
#include <linux/types.h>
#ifndef ULLONG_MAX
-#define ULLONG_MAX (~0ULL)
+#define ULLONG_MAX (~0ULL)
#endif
#ifndef LLONG_MAX
-#define LLONG_MAX ((long long)(~0ULL>>1))
+#define LLONG_MAX ((long long)(~0ULL>>1))
#endif
typedef enum {
diff --git a/include/spl/sys/vnode.h b/include/spl/sys/vnode.h
index a3f7828e7..d3b903f13 100644
--- a/include/spl/sys/vnode.h
+++ b/include/spl/sys/vnode.h
@@ -86,7 +86,7 @@
#define AT_MTIME ATTR_MTIME
#define AT_CTIME ATTR_CTIME
-#define ATTR_XVATTR (1 << 31)
+#define ATTR_XVATTR (1U << 31)
#define AT_XVATTR ATTR_XVATTR
#define ATTR_IATTR_MASK (ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_SIZE | \
@@ -120,7 +120,7 @@ typedef enum vtype {
typedef struct vattr {
enum vtype va_type; /* vnode type */
- uint_t va_mask; /* attribute bit-mask */
+ uint32_t va_mask; /* attribute bit-mask */
ushort_t va_mode; /* acc mode */
uid_t va_uid; /* owner uid */
gid_t va_gid; /* owner gid */
diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am
index e73be52f3..06306b876 100644
--- a/include/sys/Makefile.am
+++ b/include/sys/Makefile.am
@@ -42,6 +42,7 @@ COMMON_H = \
$(top_srcdir)/include/sys/mmp.h \
$(top_srcdir)/include/sys/mntent.h \
$(top_srcdir)/include/sys/multilist.h \
+ $(top_srcdir)/include/sys/note.h \
$(top_srcdir)/include/sys/nvpair.h \
$(top_srcdir)/include/sys/nvpair_impl.h \
$(top_srcdir)/include/sys/pathname.h \
diff --git a/include/sys/abd.h b/include/sys/abd.h
index cd7105013..077bb9d17 100644
--- a/include/sys/abd.h
+++ b/include/sys/abd.h
@@ -27,7 +27,6 @@
#define _ABD_H
#include <sys/isa_defs.h>
-#include <sys/int_types.h>
#include <sys/debug.h>
#include <sys/refcount.h>
#ifdef _KERNEL
@@ -116,7 +115,7 @@ int abd_cmp(abd_t *, abd_t *);
int abd_cmp_buf_off(abd_t *, const void *, size_t, size_t);
void abd_zero_off(abd_t *, size_t, size_t);
-#if defined(_KERNEL) && defined(HAVE_SPL)
+#if defined(_KERNEL)
unsigned int abd_scatter_bio_map_off(struct bio *, abd_t *, unsigned int,
size_t);
unsigned long abd_nr_pages_off(abd_t *, unsigned int, size_t);
diff --git a/include/sys/fm/protocol.h b/include/sys/fm/protocol.h
index 74aef3a92..78031f7c1 100644
--- a/include/sys/fm/protocol.h
+++ b/include/sys/fm/protocol.h
@@ -31,7 +31,6 @@ extern "C" {
#endif
#ifdef _KERNEL
-#include <sys/varargs.h>
#include <sys/nvpair.h>
#else
#include <libnvpair.h>
diff --git a/include/sys/note.h b/include/sys/note.h
new file mode 100644
index 000000000..33b547668
--- /dev/null
+++ b/include/sys/note.h
@@ -0,0 +1,56 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License, Version 1.0 only
+ * (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) 1994 by Sun Microsystems, Inc.
+ */
+
+/*
+ * sys/note.h: interface for annotating source with info for tools
+ *
+ * This is the underlying interface; NOTE (/usr/include/note.h) is the
+ * preferred interface, but all exported header files should include this
+ * file directly and use _NOTE so as not to take "NOTE" from the user's
+ * namespace. For consistency, *all* kernel source should use _NOTE.
+ *
+ * By default, annotations expand to nothing. This file implements
+ * that. Tools using annotations will interpose a different version
+ * of this file that will expand annotations as needed.
+ */
+
+#ifndef _SYS_NOTE_H
+#define _SYS_NOTE_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef _NOTE
+#define _NOTE(s)
+#endif
+
+#define NOTE(s) _NOTE(s)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SYS_NOTE_H */
diff --git a/include/sys/nvpair.h b/include/sys/nvpair.h
index d2dfad5ca..a840c4b05 100644
--- a/include/sys/nvpair.h
+++ b/include/sys/nvpair.h
@@ -29,11 +29,6 @@
#include <sys/types.h>
#include <sys/time.h>
#include <sys/errno.h>
-#include <sys/va_list.h>
-
-#if defined(_KERNEL) && !defined(_BOOT)
-#include <sys/kmem.h>
-#endif
#ifdef __cplusplus
extern "C" {
@@ -142,7 +137,7 @@ struct nv_alloc_ops {
extern const nv_alloc_ops_t *nv_fixed_ops;
extern nv_alloc_t *nv_alloc_nosleep;
-#if defined(_KERNEL) && !defined(_BOOT)
+#if defined(_KERNEL)
extern nv_alloc_t *nv_alloc_sleep;
extern nv_alloc_t *nv_alloc_pushpage;
#endif
diff --git a/include/sys/xvattr.h b/include/sys/xvattr.h
index 1c919454d..68610c496 100644
--- a/include/sys/xvattr.h
+++ b/include/sys/xvattr.h
@@ -40,6 +40,7 @@
#define _SYS_XVATTR_H
#include <sys/vnode.h>
+#include <sys/strings.h>
#define AV_SCANSTAMP_SZ 32 /* length of anti-virus scanstamp */
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
index 37bdc533c..170a909b4 100644
--- a/include/sys/zfs_context.h
+++ b/include/sys/zfs_context.h
@@ -32,31 +32,25 @@
#include <sys/note.h>
#include <sys/types.h>
-#include <sys/t_lock.h>
#include <sys/atomic.h>
#include <sys/sysmacros.h>
-#include <sys/bitmap.h>
+#include <sys/vmsystm.h>
+#include <sys/condvar.h>
#include <sys/cmn_err.h>
#include <sys/kmem.h>
#include <sys/kmem_cache.h>
#include <sys/vmem.h>
#include <sys/taskq.h>
-#include <sys/buf.h>
#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/cpuvar.h>
#include <sys/kobj.h>
-#include <sys/conf.h>
#include <sys/disp.h>
#include <sys/debug.h>
#include <sys/random.h>
+#include <sys/strings.h>
#include <sys/byteorder.h>
-#include <sys/systm.h>
#include <sys/list.h>
#include <sys/uio_impl.h>
-#include <sys/dirent.h>
#include <sys/time.h>
-#include <vm/seg_kmem.h>
#include <sys/zone.h>
#include <sys/sdt.h>
#include <sys/kstat.h>
@@ -76,8 +70,6 @@
#define _SYS_MUTEX_H
#define _SYS_RWLOCK_H
#define _SYS_CONDVAR_H
-#define _SYS_SYSTM_H
-#define _SYS_T_LOCK_H
#define _SYS_VNODE_H
#define _SYS_VFS_H
#define _SYS_SUNDDI_H
diff --git a/include/sys/zfs_delay.h b/include/sys/zfs_delay.h
index b56a7daa7..40e617dba 100644
--- a/include/sys/zfs_delay.h
+++ b/include/sys/zfs_delay.h
@@ -22,7 +22,7 @@
#ifndef _SYS_FS_ZFS_DELAY_H
#define _SYS_FS_ZFS_DELAY_H
-#include <linux/delay_compat.h>
+#include <sys/timer.h>
/*
* Generic wrapper to sleep until a given time.
diff --git a/include/sys/zfs_fuid.h b/include/sys/zfs_fuid.h
index 0feb3ce4b..5c56f7fcc 100644
--- a/include/sys/zfs_fuid.h
+++ b/include/sys/zfs_fuid.h
@@ -27,7 +27,6 @@
#define _SYS_FS_ZFS_FUID_H
#ifdef _KERNEL
-#include <sys/kidmap.h>
#include <sys/sid.h>
#include <sys/dmu.h>
#include <sys/zfs_vfsops.h>
diff --git a/include/sys/zfs_znode.h b/include/sys/zfs_znode.h
index 311babe59..3f2bd1fbb 100644
--- a/include/sys/zfs_znode.h
+++ b/include/sys/zfs_znode.h
@@ -30,7 +30,6 @@
#ifdef _KERNEL
#include <sys/isa_defs.h>
#include <sys/types32.h>
-#include <sys/attr.h>
#include <sys/list.h>
#include <sys/dmu.h>
#include <sys/sa.h>
diff --git a/include/sys/zpl.h b/include/sys/zpl.h
index 65ed43136..5df7bd1ac 100644
--- a/include/sys/zpl.h
+++ b/include/sys/zpl.h
@@ -31,7 +31,6 @@
#include <linux/dcache_compat.h>
#include <linux/exportfs.h>
#include <linux/falloc.h>
-#include <linux/file_compat.h>
#include <linux/parser.h>
#include <linux/task_io_accounting_ops.h>
#include <linux/vfs_compat.h>