From 7ddb753d17f2c12f152647c0e34eb9c42ee5e4af Mon Sep 17 00:00:00 2001 From: Matthew Macy Date: Wed, 1 Jul 2020 09:10:08 -0700 Subject: freebsd: changes necessary to coexist with dtrace in tree Fix header conflicts when building zfs with openzfs as a vendor import. Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Signed-off-by: Matt Macy Closes #10497 --- include/os/freebsd/spl/sys/ccompile.h | 10 +++++++--- include/os/freebsd/spl/sys/condvar.h | 1 - include/os/freebsd/spl/sys/file.h | 2 ++ include/os/freebsd/spl/sys/mount.h | 3 ++- include/os/freebsd/spl/sys/sunddi.h | 2 ++ 5 files changed, 13 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/os/freebsd/spl/sys/ccompile.h b/include/os/freebsd/spl/sys/ccompile.h index f9b09d430..4dda0756f 100644 --- a/include/os/freebsd/spl/sys/ccompile.h +++ b/include/os/freebsd/spl/sys/ccompile.h @@ -160,11 +160,13 @@ 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; -#include + typedef void zfs_kernel_param_t; +#endif #define param_set_charp(a, b) (0) #define ATTR_UID AT_UID #define ATTR_GID AT_GID @@ -179,6 +181,9 @@ typedef void zfs_kernel_param_t; #define MUTEX_NOLOCKDEP 0 #define RW_NOLOCKDEP 0 +#if !defined(LOCORE) && !defined(_ASM) +#include +#include #if __FreeBSD_version < 1300051 #define vm_page_valid(m) (m)->valid = VM_PAGE_BITS_ALL @@ -207,7 +212,6 @@ typedef void zfs_kernel_param_t; #else #define getnewvnode_reserve_() getnewvnode_reserve(1) #endif - struct hlist_node { struct hlist_node *next, **pprev; }; @@ -288,7 +292,7 @@ atomic_dec(atomic_t *v) { return (atomic_fetchadd_int(&v->counter, -1) - 1); } - +#endif #else typedef long loff_t; typedef long rlim64_t; diff --git a/include/os/freebsd/spl/sys/condvar.h b/include/os/freebsd/spl/sys/condvar.h index 4375bd6a3..2e99a1a34 100644 --- a/include/os/freebsd/spl/sys/condvar.h +++ b/include/os/freebsd/spl/sys/condvar.h @@ -35,7 +35,6 @@ #include #include #include -#include /* * cv_timedwait() is similar to cv_wait() except that it additionally expects diff --git a/include/os/freebsd/spl/sys/file.h b/include/os/freebsd/spl/sys/file.h index 10a82c204..0d0be44f8 100644 --- a/include/os/freebsd/spl/sys/file.h +++ b/include/os/freebsd/spl/sys/file.h @@ -29,6 +29,8 @@ #ifndef _OPENSOLARIS_SYS_FILE_H_ #define _OPENSOLARIS_SYS_FILE_H_ +#include +#include_next #include_next #define FKIOCTL 0x80000000 /* ioctl addresses are from kernel */ diff --git a/include/os/freebsd/spl/sys/mount.h b/include/os/freebsd/spl/sys/mount.h index 4732d283b..42614e473 100644 --- a/include/os/freebsd/spl/sys/mount.h +++ b/include/os/freebsd/spl/sys/mount.h @@ -31,8 +31,9 @@ #include #include_next +#ifdef BUILDING_ZFS #include - +#endif #define MS_FORCE MNT_FORCE #define MS_REMOUNT MNT_UPDATE diff --git a/include/os/freebsd/spl/sys/sunddi.h b/include/os/freebsd/spl/sys/sunddi.h index bb76cd964..41d0f4512 100644 --- a/include/os/freebsd/spl/sys/sunddi.h +++ b/include/os/freebsd/spl/sys/sunddi.h @@ -29,7 +29,9 @@ #include #include #include +#ifdef BUILDING_ZFS #include +#endif typedef int ddi_devid_t; -- cgit v1.2.3