Refactor ccompile.h to not include system headers

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
This commit is contained in:
Matthew Macy
2020-07-25 20:09:50 -07:00
committed by GitHub
parent 6d8da84106
commit e64cc4954c
39 changed files with 224 additions and 141 deletions
+2 -2
View 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
+1
View 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>
+1 -1
View 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>
+1
View 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>
+3
View 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
+1
View 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>
+1
View 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>
+1
View 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>
+1
View 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>
+1
View 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>
+1
View 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>
+1
View 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>
+1
View 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>
+1
View 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>
+1 -1
View File
@@ -40,7 +40,7 @@
* $FreeBSD$
*/
#include <sys/types.h>
#include <sys/param.h>
#include <sys/uio.h>
#include <sys/vnode.h>
+3
View 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
+1
View 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>
+1
View 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>
+1
View 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>
+1
View 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>
+3
View 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)
+4
View 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 |
+2
View 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.
+1
View 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"
+2
View 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)
@@ -41,6 +41,7 @@
* SOFTWARE.
*/
#include <sys/param.h>
#include <sys/byteorder.h>
#include <sys/spa_checksum.h>
#include <sys/strings.h>
@@ -41,6 +41,7 @@
* SOFTWARE.
*/
#include <sys/param.h>
#include <sys/byteorder.h>
#include <sys/spa_checksum.h>
#include <sys/strings.h>
+4
View File
@@ -27,10 +27,14 @@
#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)
+2
View 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)