aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2020-07-01 09:10:08 -0700
committerGitHub <[email protected]>2020-07-01 09:10:08 -0700
commit7ddb753d17f2c12f152647c0e34eb9c42ee5e4af (patch)
treeab796d8c21e0317bf2c8ba7d2f75eb9c903103ce /module
parent22831636c8c132c62c771c64e7131b422e41be34 (diff)
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 <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #10497
Diffstat (limited to 'module')
-rw-r--r--module/Makefile.bsd1
-rw-r--r--module/os/freebsd/spl/spl_misc.c19
-rw-r--r--module/os/freebsd/spl/spl_sysevent.c1
-rw-r--r--module/os/freebsd/zfs/arc_os.c1
-rw-r--r--module/os/freebsd/zfs/sysctl_os.c4
-rw-r--r--module/os/freebsd/zfs/vdev_file.c1
-rw-r--r--module/os/freebsd/zfs/vdev_geom.c1
-rw-r--r--module/zfs/spa_config.c1
8 files changed, 20 insertions, 9 deletions
diff --git a/module/Makefile.bsd b/module/Makefile.bsd
index a46b92051..7c83113ac 100644
--- a/module/Makefile.bsd
+++ b/module/Makefile.bsd
@@ -331,6 +331,7 @@ CFLAGS.fm.c= -Wno-cast-qual
CFLAGS.lz4.c= -Wno-cast-qual
CFLAGS.spa.c= -Wno-cast-qual
CFLAGS.spa_misc.c= -Wno-cast-qual
+CFLAGS.sysctl_os.c= -include ../zfs_config.h
CFLAGS.vdev_raidz.c= -Wno-cast-qual
CFLAGS.vdev_raidz_math.c= -Wno-cast-qual
CFLAGS.vdev_raidz_math_scalar.c= -Wno-cast-qual
diff --git a/module/os/freebsd/spl/spl_misc.c b/module/os/freebsd/spl/spl_misc.c
index ab4702574..8d33916d8 100644
--- a/module/os/freebsd/spl/spl_misc.c
+++ b/module/os/freebsd/spl/spl_misc.c
@@ -34,15 +34,24 @@ __FBSDID("$FreeBSD$");
#include <sys/limits.h>
#include <sys/misc.h>
#include <sys/sysctl.h>
+#include <sys/vnode.h>
#include <sys/zfs_context.h>
-char hw_serial[11] = "0";
-
static struct opensolaris_utsname hw_utsname = {
.machine = MACHINE
};
+#ifndef KERNEL_STATIC
+char hw_serial[11] = "0";
+
+utsname_t *
+utsname(void)
+{
+ return (&hw_utsname);
+}
+#endif
+
static void
opensolaris_utsname_init(void *arg)
{
@@ -98,10 +107,6 @@ spl_panic(const char *file, const char *func, int line, const char *fmt, ...)
va_end(ap);
}
-utsname_t *
-utsname(void)
-{
- return (&hw_utsname);
-}
+
SYSINIT(opensolaris_utsname_init, SI_SUB_TUNABLES, SI_ORDER_ANY,
opensolaris_utsname_init, NULL);
diff --git a/module/os/freebsd/spl/spl_sysevent.c b/module/os/freebsd/spl/spl_sysevent.c
index d3748276a..4bb0658c8 100644
--- a/module/os/freebsd/spl/spl_sysevent.c
+++ b/module/os/freebsd/spl/spl_sysevent.c
@@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/kmem.h>
+#include <sys/list.h>
#include <sys/sbuf.h>
#include <sys/nvpair.h>
#include <sys/sunddi.h>
diff --git a/module/os/freebsd/zfs/arc_os.c b/module/os/freebsd/zfs/arc_os.c
index 23b580c43..87e517b58 100644
--- a/module/os/freebsd/zfs/arc_os.c
+++ b/module/os/freebsd/zfs/arc_os.c
@@ -44,6 +44,7 @@
#include <sys/arc_impl.h>
#include <sys/sdt.h>
#include <sys/aggsum.h>
+#include <sys/vnode.h>
#include <cityhash.h>
extern struct vfsops zfs_vfsops;
diff --git a/module/os/freebsd/zfs/sysctl_os.c b/module/os/freebsd/zfs/sysctl_os.c
index 6d5c88e21..54b62f248 100644
--- a/module/os/freebsd/zfs/sysctl_os.c
+++ b/module/os/freebsd/zfs/sysctl_os.c
@@ -90,7 +90,6 @@ __FBSDID("$FreeBSD$");
#include <sys/arc_impl.h>
#include <sys/dsl_pool.h>
-#include <../zfs_config.h>
/* BEGIN CSTYLED */
SYSCTL_DECL(_vfs_zfs);
@@ -124,10 +123,11 @@ SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, cache, CTLFLAG_RW, 0, "ZFS VDEV Cache");
SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, mirror, CTLFLAG_RD, 0,
"ZFS VDEV mirror");
+#ifdef ZFS_META_VERSION
SYSCTL_DECL(_vfs_zfs_version);
SYSCTL_CONST_STRING(_vfs_zfs_version, OID_AUTO, module, CTLFLAG_RD,
(ZFS_META_VERSION "-" ZFS_META_RELEASE), "OpenZFS module version");
-
+#endif
extern arc_state_t ARC_anon;
extern arc_state_t ARC_mru;
extern arc_state_t ARC_mru_ghost;
diff --git a/module/os/freebsd/zfs/vdev_file.c b/module/os/freebsd/zfs/vdev_file.c
index 01851378e..cca6bffd9 100644
--- a/module/os/freebsd/zfs/vdev_file.c
+++ b/module/os/freebsd/zfs/vdev_file.c
@@ -25,6 +25,7 @@
#include <sys/zfs_context.h>
#include <sys/spa.h>
+#include <sys/file.h>
#include <sys/vdev_file.h>
#include <sys/vdev_impl.h>
#include <sys/zio.h>
diff --git a/module/os/freebsd/zfs/vdev_geom.c b/module/os/freebsd/zfs/vdev_geom.c
index 69a73103c..8462755f8 100644
--- a/module/os/freebsd/zfs/vdev_geom.c
+++ b/module/os/freebsd/zfs/vdev_geom.c
@@ -29,6 +29,7 @@
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/bio.h>
+#include <sys/file.h>
#include <sys/spa.h>
#include <sys/spa_impl.h>
#include <sys/vdev_impl.h>
diff --git a/module/zfs/spa_config.c b/module/zfs/spa_config.c
index 3a65b0bb4..b30c65e71 100644
--- a/module/zfs/spa_config.c
+++ b/module/zfs/spa_config.c
@@ -27,6 +27,7 @@
*/
#include <sys/spa.h>
+#include <sys/file.h>
#include <sys/fm/fs/zfs.h>
#include <sys/spa_impl.h>
#include <sys/nvpair.h>