]> git.proxmox.com Git - mirror_zfs.git/commitdiff
Refactor ccompile.h to not include system headers
authorMatthew Macy <mmacy@mattmacy.io>
Sun, 26 Jul 2020 03:09:50 +0000 (20:09 -0700)
committerGitHub <noreply@github.com>
Sun, 26 Jul 2020 03:09:50 +0000 (20:09 -0700)
This is a step toward being able to vendor the OpenZFS code in FreeBSD.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
Closes #10625

39 files changed:
include/os/freebsd/linux/types.h
include/os/freebsd/spl/sys/ccompat.h [new file with mode: 0644]
include/os/freebsd/spl/sys/ccompile.h
include/os/freebsd/spl/sys/condvar.h
include/os/freebsd/spl/sys/kstat.h
include/os/freebsd/spl/sys/param.h
include/os/freebsd/spl/sys/systm.h
include/os/freebsd/spl/sys/types.h
include/os/freebsd/zfs/sys/zfs_context_os.h
include/sys/zfs_context.h
module/Makefile.bsd
module/nvpair/nvpair.c
module/os/freebsd/spl/callb.c
module/os/freebsd/spl/spl_acl.c
module/os/freebsd/spl/spl_cmn_err.c
module/os/freebsd/spl/spl_dtrace.c
module/os/freebsd/spl/spl_kmem.c
module/os/freebsd/spl/spl_kstat.c
module/os/freebsd/spl/spl_misc.c
module/os/freebsd/spl/spl_policy.c
module/os/freebsd/spl/spl_string.c
module/os/freebsd/spl/spl_sunddi.c
module/os/freebsd/spl/spl_sysevent.c
module/os/freebsd/spl/spl_taskq.c
module/os/freebsd/spl/spl_uio.c
module/os/freebsd/spl/spl_vfs.c
module/os/freebsd/spl/spl_vm.c
module/os/freebsd/spl/spl_zlib.c
module/os/freebsd/spl/spl_zone.c
module/os/freebsd/zfs/abd_os.c
module/os/freebsd/zfs/dmu_os.c
module/os/freebsd/zfs/zfs_ctldir.c
module/os/freebsd/zfs/zfs_dir.c
module/zcommon/zfeature_common.c
module/zcommon/zfs_fletcher_avx512.c
module/zcommon/zfs_fletcher_superscalar.c
module/zcommon/zfs_fletcher_superscalar4.c
module/zfs/vdev_raidz_math_avx512bw.c
module/zfs/vdev_raidz_math_ssse3.c

index 301163c034f56a7ae9ca04f8b6aef1349efcc501..d290317cc0dd71e73c62fd69ce87f3fa031b5fe1 100644 (file)
@@ -31,9 +31,6 @@
 #ifndef        _LINUX_TYPES_H_
 #define        _LINUX_TYPES_H_
 
-#include <sys/cdefs.h>
-#include <sys/types.h>
-#include <sys/systm.h>
 #include <linux/compiler.h>
 
 
@@ -53,7 +50,7 @@ typedef uint64_t __le64;
 typedef uint64_t __be64;
 
 typedef unsigned gfp_t;
-typedef uint64_t loff_t;
+typedef off_t loff_t;
 typedef vm_paddr_t resource_size_t;
 typedef uint16_t __bitwise__ __sum16;
 typedef unsigned long pgoff_t;
diff --git a/include/os/freebsd/spl/sys/ccompat.h b/include/os/freebsd/spl/sys/ccompat.h
new file mode 100644 (file)
index 0000000..6c87676
--- /dev/null
@@ -0,0 +1,138 @@
+/*
+ * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef        _SYS_CCOMPAT_H
+#define        _SYS_CCOMPAT_H
+
+#if  __FreeBSD_version < 1300051
+#define        vm_page_valid(m) (m)->valid = VM_PAGE_BITS_ALL
+#define        vm_page_do_sunbusy(m)
+#define        vm_page_none_valid(m) ((m)->valid == 0)
+#else
+#define        vm_page_do_sunbusy(m) vm_page_sunbusy(m)
+#endif
+
+#if  __FreeBSD_version < 1300074
+#define        VOP_UNLOCK1(x)  VOP_UNLOCK(x, 0)
+#else
+#define        VOP_UNLOCK1(x)  VOP_UNLOCK(x)
+#endif
+
+#if  __FreeBSD_version < 1300064
+#define        VN_IS_DOOMED(vp)        ((vp)->v_iflag & VI_DOOMED)
+#endif
+
+#if  __FreeBSD_version < 1300068
+#define        VFS_VOP_VECTOR_REGISTER(x)
+#endif
+
+#if  __FreeBSD_version >= 1300076
+#define        getnewvnode_reserve_()  getnewvnode_reserve()
+#else
+#define        getnewvnode_reserve_()  getnewvnode_reserve(1)
+#endif
+struct hlist_node {
+       struct hlist_node *next, **pprev;
+};
+
+struct hlist_head {
+       struct hlist_node *first;
+};
+
+typedef struct {
+       volatile int counter;
+} atomic_t;
+
+       /* BEGIN CSTYLED */
+#define        hlist_for_each(p, head)                                      \
+       for (p = (head)->first; p; p = (p)->next)
+
+#define        hlist_entry(ptr, type, field)   container_of(ptr, type, field)
+
+#define        container_of(ptr, type, member)                         \
+({                                                              \
+        const __typeof(((type *)0)->member) *__p = (ptr);       \
+        (type *)((uintptr_t)__p - offsetof(type, member));      \
+})
+       /* END CSTYLED */
+
+static inline void
+hlist_add_head(struct hlist_node *n, struct hlist_head *h)
+{
+       n->next = h->first;
+       if (h->first != NULL)
+               h->first->pprev = &n->next;
+       WRITE_ONCE(h->first, n);
+       n->pprev = &h->first;
+}
+
+static inline void
+hlist_del(struct hlist_node *n)
+{
+       WRITE_ONCE(*(n->pprev), n->next);
+       if (n->next != NULL)
+               n->next->pprev = n->pprev;
+}
+       /* BEGIN CSTYLED */
+#define        READ_ONCE(x) ({                 \
+       __typeof(x) __var = ({          \
+               barrier();              \
+               ACCESS_ONCE(x);         \
+       });                             \
+       barrier();                      \
+       __var;                          \
+})
+
+#define        HLIST_HEAD_INIT { }
+#define        HLIST_HEAD(name) struct hlist_head name = HLIST_HEAD_INIT
+#define        INIT_HLIST_HEAD(head) (head)->first = NULL
+
+#define        INIT_HLIST_NODE(node)                                   \
+       do {                                                                                                                            \
+               (node)->next = NULL;                                                                                    \
+               (node)->pprev = NULL;                                                                                   \
+       } while (0)
+
+/* END CSTYLED */
+static inline int
+atomic_read(const atomic_t *v)
+{
+       return (READ_ONCE(v->counter));
+}
+
+static inline int
+atomic_inc(atomic_t *v)
+{
+       return (atomic_fetchadd_int(&v->counter, 1) + 1);
+}
+
+static inline int
+atomic_dec(atomic_t *v)
+{
+       return (atomic_fetchadd_int(&v->counter, -1) - 1);
+}
+#endif
index 116612b611f2c056cafc2df2820d7c4956e06ebd..cfb94268bf559b10465935f2e8f64fc93bdef365 100644 (file)
@@ -164,14 +164,19 @@ extern "C" {
 
 #define        KMALLOC_MAX_SIZE MAXPHYS
 
-#ifdef _KERNEL
-#if !defined(LOCORE) && !defined(_ASM)
-typedef unsigned long long     u_longlong_t;
-typedef long long              longlong_t;
-
+#ifndef LOCORE
+#ifndef HAVE_RPC_TYPES
+typedef int bool_t;
+typedef int enum_t;
+#endif
+#endif
 
-typedef        void zfs_kernel_param_t;
+#ifndef __cplusplus
+#define        __init
+#define        __exit
 #endif
+
+#ifdef _KERNEL
 #define        param_set_charp(a, b) (0)
 #define        ATTR_UID AT_UID
 #define        ATTR_GID AT_GID
@@ -186,127 +191,7 @@ typedef   void zfs_kernel_param_t;
 #define        MUTEX_NOLOCKDEP 0
 #define        RW_NOLOCKDEP 0
 
-#if !defined(LOCORE) && !defined(_ASM)
-#include <sys/param.h>
-#include <linux/types.h>
-
-#if  __FreeBSD_version < 1300051
-#define        vm_page_valid(m) (m)->valid = VM_PAGE_BITS_ALL
-#define        vm_page_do_sunbusy(m)
-#define        vm_page_none_valid(m) ((m)->valid == 0)
-#else
-#define        vm_page_do_sunbusy(m) vm_page_sunbusy(m)
-#endif
-
-#if  __FreeBSD_version < 1300074
-#define        VOP_UNLOCK1(x)  VOP_UNLOCK(x, 0)
 #else
-#define        VOP_UNLOCK1(x)  VOP_UNLOCK(x)
-#endif
-
-#if  __FreeBSD_version < 1300064
-#define        VN_IS_DOOMED(vp)        ((vp)->v_iflag & VI_DOOMED)
-#endif
-
-#if  __FreeBSD_version < 1300068
-#define        VFS_VOP_VECTOR_REGISTER(x)
-#endif
-
-#if  __FreeBSD_version >= 1300076
-#define        getnewvnode_reserve_()  getnewvnode_reserve()
-#else
-#define        getnewvnode_reserve_()  getnewvnode_reserve(1)
-#endif
-struct hlist_node {
-       struct hlist_node *next, **pprev;
-};
-
-struct hlist_head {
-       struct hlist_node *first;
-};
-
-typedef struct {
-       volatile int counter;
-} atomic_t;
-
-       /* BEGIN CSTYLED */
-#define        hlist_for_each(p, head)                                      \
-       for (p = (head)->first; p; p = (p)->next)
-
-#define        hlist_entry(ptr, type, field)   container_of(ptr, type, field)
-
-#define        container_of(ptr, type, member)                         \
-({                                                              \
-        const __typeof(((type *)0)->member) *__p = (ptr);       \
-        (type *)((uintptr_t)__p - offsetof(type, member));      \
-})
-       /* END CSTYLED */
-
-static inline void
-hlist_add_head(struct hlist_node *n, struct hlist_head *h)
-{
-       n->next = h->first;
-       if (h->first != NULL)
-               h->first->pprev = &n->next;
-       WRITE_ONCE(h->first, n);
-       n->pprev = &h->first;
-}
-
-static inline void
-hlist_del(struct hlist_node *n)
-{
-       WRITE_ONCE(*(n->pprev), n->next);
-       if (n->next != NULL)
-               n->next->pprev = n->pprev;
-}
-       /* BEGIN CSTYLED */
-#define        READ_ONCE(x) ({                 \
-       __typeof(x) __var = ({          \
-               barrier();              \
-               ACCESS_ONCE(x);         \
-       });                             \
-       barrier();                      \
-       __var;                          \
-})
-
-#define        HLIST_HEAD_INIT { }
-#define        HLIST_HEAD(name) struct hlist_head name = HLIST_HEAD_INIT
-#define        INIT_HLIST_HEAD(head) (head)->first = NULL
-
-#define        INIT_HLIST_NODE(node)                                   \
-       do {                                                                                                                            \
-               (node)->next = NULL;                                                                                    \
-               (node)->pprev = NULL;                                                                                   \
-       } while (0)
-
-/* END CSTYLED */
-static inline int
-atomic_read(const atomic_t *v)
-{
-       return (READ_ONCE(v->counter));
-}
-
-static inline int
-atomic_inc(atomic_t *v)
-{
-       return (atomic_fetchadd_int(&v->counter, 1) + 1);
-}
-
-static inline int
-atomic_dec(atomic_t *v)
-{
-       return (atomic_fetchadd_int(&v->counter, -1) - 1);
-}
-#endif
-#else
-typedef long loff_t;
-typedef long rlim64_t;
-typedef int bool_t;
-typedef int enum_t;
-#ifndef __cplusplus
-#define        __init
-#endif
-#define        __exit
 #define        FALSE 0
 #define        TRUE 1
        /*
index 2e99a1a34e18b103562b4e22ba29089db46a9931..a42995793bc20063d45378be64475e085f35d981 100644 (file)
@@ -31,6 +31,7 @@
 #define        _OPENSOLARIS_SYS_CONDVAR_H_
 
 #include <sys/param.h>
+#include <sys/systm.h>
 
 #include <sys/spl_condvar.h>
 #include <sys/mutex.h>
index 740f24b707207c4ef611e78e3213cbd91097ac8a..74c3da8ec376e07b05103d3bd874eff10791b148 100644 (file)
@@ -24,6 +24,7 @@
 
 #ifndef _SPL_KSTAT_H
 #define        _SPL_KSTAT_H
+#include <sys/types.h>
 #include <sys/sysctl.h>
 struct list_head {};
 #include <sys/mutex.h>
index 01392dd67201238834b88e5a4716244acd422efb..92724e332d680d304e4a018a1c4d6da1922567eb 100644 (file)
 #ifndef _COMPAT_OPENSOLARIS_SYS_PARAM_H_
 #define        _COMPAT_OPENSOLARIS_SYS_PARAM_H_
 
+#include <sys/types.h>
 #include_next <sys/param.h>
-
 #define        PAGESIZE        PAGE_SIZE
 #define        ptob(x)         ((uint64_t)(x) << PAGE_SHIFT)
-
+#ifdef _KERNEL
+#include <sys/systm.h>
+#include <sys/libkern.h>
+#endif
 #endif
index 53cc6f52717e4218d9e2714c7278fa26b63673ae..98ee9557527cf229ef65e255966110a4e55678d4 100644 (file)
@@ -29,7 +29,7 @@
 #ifndef _OPENSOLARIS_SYS_SYSTM_H_
 #define        _OPENSOLARIS_SYS_SYSTM_H_
 
-#include <sys/param.h>
+#include <sys/endian.h>
 #include_next <sys/systm.h>
 
 #include <sys/string.h>
index ed5e8ef80bf97bb6d3aaeaf9d33e6139a8c8d40a..c06c963d64b92ad7107f66f09c8f058ca814204f 100644 (file)
 /*
  * This is a bag of dirty hacks to keep things compiling.
  */
+#include_next <sys/types.h>
 
+#ifdef __ILP32__
+typedef __uint64_t u_longlong_t;
+typedef __int64_t longlong_t;
+#else
+typedef unsigned long long     u_longlong_t;
+typedef long long              longlong_t;
+#endif
 #include <sys/stdint.h>
 
-typedef        int64_t         clock_t;
 #define        _CLOCK_T_DECLARED
 
-#include_next <sys/types.h>
 #include <sys/types32.h>
 #include <sys/_stdarg.h>
+#include <linux/types.h>
 
 #define        MAXNAMELEN      256
 
+
+
+typedef        void zfs_kernel_param_t;
+
 typedef        struct timespec timestruc_t;
 typedef        struct timespec timespec_t;
 typedef struct timespec inode_timespec_t;
@@ -93,5 +104,5 @@ typedef      u_longlong_t    len_t;
 
 typedef        longlong_t      diskaddr_t;
 
-
+#include <sys/debug.h>
 #endif /* !_OPENSOLARIS_SYS_TYPES_H_ */
index 529ba7204548ea07de7946a62add1555551914db..8da3374a6ffd7bc0b59ecce7788415b2cca2cf61 100644 (file)
@@ -37,6 +37,9 @@
 #include <sys/kdb.h>
 #include <sys/pathname.h>
 #include <sys/conf.h>
+#include <sys/types.h>
+#include <sys/ccompat.h>
+#include <linux/types.h>
 
 #define        cv_wait_io(cv, mp)                      cv_wait(cv, mp)
 #define        cv_wait_io_sig(cv, mp)                  cv_wait_sig(cv, mp)
index 95f963e73642021d3c10d78170d453321029b9f0..ccae941b4bd878184ff7dedd5858b5820be33594 100644 (file)
@@ -335,6 +335,9 @@ extern void cv_broadcast(kcondvar_t *cv);
 #define        tsd_set(k, v) pthread_setspecific(k, v)
 #define        tsd_create(kp, d) pthread_key_create((pthread_key_t *)kp, d)
 #define        tsd_destroy(kp) /* nothing */
+#ifdef __FreeBSD__
+typedef off_t loff_t;
+#endif
 
 /*
  * kstat creation, installation and deletion
index 6fd00f47468bce75d346df8309077bee7d0a1bba..517054b0ecafc74ec8f144431673878a39f6e48e 100644 (file)
@@ -32,7 +32,7 @@ CFLAGS+= -DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_
 CFLAGS+= -D_SYS_VMEM_H_ -D_MACHINE_ENDIAN_H_ -DKDTRACE_HOOKS -DSMP
 
 .if ${MACHINE_ARCH} == "amd64"
-CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F
+CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F -DHAVE_SSSE3
 .endif
 
 .if defined(WITH_DEBUG) && ${WITH_DEBUG} == "true"
@@ -310,7 +310,7 @@ CFLAGS.lcompat.c= -Wno-cast-qual
 CFLAGS.lobject.c= -Wno-cast-qual
 CFLAGS.ltable.c= -Wno-cast-qual
 CFLAGS.lvm.c= -Wno-cast-qual
-CFLAGS.nvpair.c= -Wno-cast-qual
+CFLAGS.nvpair.c= -DHAVE_RPC_TYPES -Wno-cast-qual
 CFLAGS.spl_string.c= -Wno-cast-qual
 CFLAGS.spl_vm.c= -Wno-cast-qual
 CFLAGS.spl_zlib.c= -Wno-cast-qual
index 8691aaf2cf4460d2023383e4dd78c823bce72195..6c0261f08b6a370066488f56abd9f04ba61bba33 100644 (file)
@@ -30,6 +30,7 @@
 #include <sys/nvpair.h>
 #include <sys/nvpair_impl.h>
 #include <sys/types.h>
+#include <sys/param.h>
 #include <sys/strings.h>
 #include <rpc/xdr.h>
 #include <sys/mod.h>
index 633e85bc0f156445b0e4095791c91903bebe2b0f..fffa85b6b91b7b909c062007f78ba2926edde893 100644 (file)
@@ -23,8 +23,8 @@
  * Use is subject to license terms.
  */
 
-#include <sys/param.h>
 #include <sys/types.h>
+#include <sys/param.h>
 #include <sys/time.h>
 #include <sys/sysmacros.h>
 #include <sys/systm.h>
index bb4c30728d56527ad37a56c79b1d275f2481da50..18188ca0adec729fd7668851777a57375701fa3f 100644 (file)
@@ -27,6 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/types.h>
index 23566603f5fa360e66d3e69f368f66980a304c77..22c7338b7399392c75fd711899fc5b957213553a 100644 (file)
@@ -25,6 +25,9 @@
  * Copyright 2012 Martin Matuska <mm@FreeBSD.org>. All rights reserved.
  */
 
+#include <sys/cdefs.h>
+#include <sys/param.h>
+#include <sys/systm.h>
 #include <sys/cmn_err.h>
 
 void
index e7b2ff82309424e6bd522e282c7e42177e3df27e..6b2872bcc066b6a651daf48f6e6bee5484b36a6d 100644 (file)
@@ -29,6 +29,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/queue.h>
 #include <sys/sdt.h>
index af3747c271fda8ff34eeb1b04a182d3371a864a6..cfc61dd7fc2acb86b641b97122a1ed0023897730 100644 (file)
@@ -27,6 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/byteorder.h>
 #include <sys/kernel.h>
index 234b56a495649b9f66397e7063f48949c17c9649..756667045b1739683180b5eafac14d651be684d7 100644 (file)
@@ -27,6 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/systm.h>
index 8d33916d85d161a93574a05e71b8d6cf0cb3ea92..0354b986cd5f624e9c3c61a004673ca43a702911 100644 (file)
@@ -27,6 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/jail.h>
 #include <sys/kernel.h>
index 8ef4ca88b86399b383e0ca66f38a46915c6d1de8..5cd5c69efa71349266074c3fb924faae76da333b 100644 (file)
@@ -27,6 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/priv.h>
 #include <sys/vnode.h>
index 14d816b5c3269c2c45b3d1e70ad9ad1c4bd867f1..d13b64b4cd26edec1a84f15b670c37c5a681f8b4 100644 (file)
@@ -25,6 +25,7 @@
  * Use is subject to license terms.
  */
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/string.h>
 #include <sys/kmem.h>
index 1fa4f56f1f8ce97ba86ed3f295d3973734fdcf28..ebec77bdb37f02d6f7567c3c22292366d4569723 100644 (file)
@@ -27,6 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/jail.h>
 #include <sys/kernel.h>
index 4bb0658c87977a0bfbe5cb9c74ab30f6c623e92d..53520eeafb25cc4101ee9760ef87a968f0f66e99 100644 (file)
@@ -28,6 +28,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/systm.h>
index f32dad2a2a8917764d5ba777bebdbf0c31949d70..9cdf93ea9e95a33b6b65730524ec9d71b0714093 100644 (file)
@@ -29,6 +29,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/kmem.h>
index 05dbfd06d79d02874b0c371e16ed0709267cb48f..c6b6103947181bfe805d9e45d0ebeb7f443ad969 100644 (file)
@@ -40,7 +40,7 @@
  * $FreeBSD$
  */
 
-#include <sys/types.h>
+#include <sys/param.h>
 #include <sys/uio.h>
 #include <sys/vnode.h>
 
index 99da8c976532db04c93d0071386146a5b9d401c0..d42835c202a3fd732e1450cf9df8b2bc3f63aa7a 100644 (file)
@@ -27,6 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/systm.h>
@@ -40,6 +41,8 @@ __FBSDID("$FreeBSD$");
 #include <sys/mutex.h>
 #include <sys/vnode.h>
 
+#include <sys/ccompat.h>
+
 MALLOC_DECLARE(M_MOUNT);
 
 void
index 9f7acab74564549ef9abe35df03a054e6c5fa886..b5649d519796e3feeecf61ca398acf6301ed0c15 100644 (file)
@@ -27,6 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/byteorder.h>
 #include <sys/lock.h>
index 4d53f42d3f44573ac2313fec141bec4fded5a568..079801f2d6cc3c1f66f12d7d572dd34c474fbca5 100644 (file)
@@ -28,6 +28,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/kmem.h>
 #include <sys/kmem_cache.h>
 #include <sys/zmod.h>
index 40f21934ef61d0968710cac6e5a01610c8b1f827..0b3b04d2a73e05592ba03ffa94e66cda0a91b8c2 100644 (file)
@@ -27,6 +27,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
 #include <sys/param.h>
 #include <sys/kernel.h>
 #include <sys/systm.h>
index b4d43b96a0d4aabf96d67af1a1cc95888657c171..6b325affafe7f4f02603cd1275691b4e11c75541 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <sys/abd_impl.h>
 #include <sys/param.h>
+#include <sys/types.h>
 #include <sys/zio.h>
 #include <sys/zfs_context.h>
 #include <sys/zfs_znode.h>
index 4d367af3193d8fe401c100a409b6875c44be1d2a..8e412d9c13598d8ce7a82ab6e07f4cbd3ace5e5c 100644 (file)
@@ -28,6 +28,8 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <sys/types.h>
+#include <sys/param.h>
 #include <sys/dmu.h>
 #include <sys/dmu_impl.h>
 #include <sys/dmu_tx.h>
@@ -55,6 +57,7 @@ __FBSDID("$FreeBSD$");
 #include <sys/zfs_znode.h>
 #include <sys/zfs_vnops.h>
 
+#include <sys/ccompat.h>
 
 #ifndef IDX_TO_OFF
 #define        IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT)
index 2738f53997b5aaf8516ed60cac72b2da8edf9b55..8481a9d751174004a5d71c3135a300a758487274 100644 (file)
@@ -65,6 +65,9 @@
  * so that it cannot be freed until all snapshots have been unmounted.
  */
 
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/libkern.h>
 #include <sys/dirent.h>
 #include <sys/zfs_context.h>
 #include <sys/zfs_ctldir.h>
@@ -83,6 +86,7 @@
 #include "zfs_namecheck.h"
 
 #include <sys/kernel.h>
+#include <sys/ccompat.h>
 
 /* Common access mode for all virtual directories under the ctldir */
 const uint16_t zfsctl_ctldir_mode = S_IRUSR | S_IXUSR | S_IRGRP | S_IXGRP |
index 5aa4cd525eb372015b5c5715a209d8f599db84e7..4b1f4a8832e044060bd271d44f5347732eff7e00 100644 (file)
@@ -60,6 +60,8 @@
 #include <sys/dmu_objset.h>
 #include <sys/dsl_dir.h>
 
+#include <sys/ccompat.h>
+
 /*
  * zfs_match_find() is used by zfs_dirent_lookup() to perform zap lookups
  * of names after deciding which is the appropriate lookup interface.
index 302d485703f4f351ee1196acd0fe84415e11a997..ed7967dc144d7f80a798481e270dd2f04d4bff92 100644 (file)
@@ -36,6 +36,7 @@
 #include <sys/fs/zfs.h>
 #include <sys/inttypes.h>
 #include <sys/types.h>
+#include <sys/param.h>
 #include <sys/zfs_sysfs.h>
 #include "zfeature_common.h"
 
index d33d2dc33f36cf62b3fec08aa59fca5825a46de2..300ec4c1fb69e018fc31a471147ae25395f57204 100644 (file)
@@ -31,7 +31,9 @@
 #include <sys/simd.h>
 #include <zfs_fletcher.h>
 
+#ifdef __linux__
 #define        __asm __asm__ __volatile__
+#endif
 
 static void
 fletcher_4_avx512f_init(fletcher_4_ctx_t *ctx)
index fbbbf80603abc8b64e60beb379f12ea7ff24edc3..153f5c7d75e302a20885f187b798d7363335087f 100644 (file)
@@ -41,6 +41,7 @@
  * SOFTWARE.
  */
 
+#include <sys/param.h>
 #include <sys/byteorder.h>
 #include <sys/spa_checksum.h>
 #include <sys/strings.h>
index 97fdb7b7d30a73a89fba11f53275684b9b38055f..75e6a3baf9805e571cdfed45e1bc321d20c62823 100644 (file)
@@ -41,6 +41,7 @@
  * SOFTWARE.
  */
 
+#include <sys/param.h>
 #include <sys/byteorder.h>
 #include <sys/spa_checksum.h>
 #include <sys/strings.h>
index 38cdbedf75f3c62e15c245e8b686a386a2c7028f..f06b469023eb00f4b2b4b6e59c8faaffd580a340 100644 (file)
 
 #if defined(__x86_64) && defined(HAVE_AVX512BW)
 
+#include <sys/param.h>
 #include <sys/types.h>
 #include <sys/simd.h>
 
+
+#ifdef __linux__
 #define        __asm __asm__ __volatile__
+#endif
 
 #define        _REG_CNT(_0, _1, _2, _3, _4, _5, _6, _7, N, ...) N
 #define        REG_CNT(r...) _REG_CNT(r, 8, 7, 6, 5, 4, 3, 2, 1)
index d5776a38a2e447aaaed9c621b8864a2c5457011a..5ddc079a4f5d6028129048a240662c309b7b0c62 100644 (file)
@@ -29,7 +29,9 @@
 #include <sys/types.h>
 #include <sys/simd.h>
 
+#ifdef __linux__
 #define        __asm __asm__ __volatile__
+#endif
 
 #define        _REG_CNT(_0, _1, _2, _3, _4, _5, _6, _7, N, ...) N
 #define        REG_CNT(r...) _REG_CNT(r, 8, 7, 6, 5, 4, 3, 2, 1)