summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMatthew Macy <[email protected]>2019-12-04 13:12:57 -0800
committerBrian Behlendorf <[email protected]>2019-12-04 13:12:57 -0800
commitbe627fc84711d2382d179392e3313f9fda8d24a3 (patch)
tree682926e925cdbd5bad6df0d2a8f16c48ec9ca7e3 /include
parent618b6adfbf136b3b61c6366719650ccfbad189a4 (diff)
Refactor zfs_context.h to build on FreeBSD
- on Linux move Linux specific headers to zfs_context_os.h - on FreeBSD move FreeBSD specific definitions to zfs_context_os.h - remove duplicate tsd_ definitions - remove unused AT_TYPE Reviewed-by: Jorgen Lundman <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Don Brady <[email protected]> Signed-off-by: Matt Macy <[email protected]> Closes #9668
Diffstat (limited to 'include')
-rw-r--r--include/os/linux/zfs/sys/Makefile.am1
-rw-r--r--include/os/linux/zfs/sys/zfs_context_os.h30
-rw-r--r--include/sys/zfs_context.h22
3 files changed, 35 insertions, 18 deletions
diff --git a/include/os/linux/zfs/sys/Makefile.am b/include/os/linux/zfs/sys/Makefile.am
index cb309d7fc..16df22c6c 100644
--- a/include/os/linux/zfs/sys/Makefile.am
+++ b/include/os/linux/zfs/sys/Makefile.am
@@ -16,6 +16,7 @@ KERNEL_H = \
$(top_srcdir)/include/os/linux/zfs/sys/trace_zil.h \
$(top_srcdir)/include/os/linux/zfs/sys/trace_zio.h \
$(top_srcdir)/include/os/linux/zfs/sys/trace_zrlock.h \
+ $(top_srcdir)/include/os/linux/zfs/sys/zfs_context_os.h \
$(top_srcdir)/include/os/linux/zfs/sys/zfs_ctldir.h \
$(top_srcdir)/include/os/linux/zfs/sys/zfs_dir.h \
$(top_srcdir)/include/os/linux/zfs/sys/zfs_vfsops.h \
diff --git a/include/os/linux/zfs/sys/zfs_context_os.h b/include/os/linux/zfs/sys/zfs_context_os.h
new file mode 100644
index 000000000..9e5fdd79f
--- /dev/null
+++ b/include/os/linux/zfs/sys/zfs_context_os.h
@@ -0,0 +1,30 @@
+/*
+ * 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
+ */
+
+#ifndef ZFS_CONTEXT_OS_H
+#define ZFS_CONTEXT_OS_H
+
+#include <sys/uio_impl.h>
+#include <linux/dcache_compat.h>
+#include <linux/utsname_compat.h>
+
+#endif
diff --git a/include/sys/zfs_context.h b/include/sys/zfs_context.h
index c14d92a2c..5a67ca677 100644
--- a/include/sys/zfs_context.h
+++ b/include/sys/zfs_context.h
@@ -29,7 +29,6 @@
#define _SYS_ZFS_CONTEXT_H
#ifdef __KERNEL__
-
#include <sys/note.h>
#include <sys/types.h>
#include <sys/atomic.h>
@@ -48,7 +47,6 @@
#include <sys/strings.h>
#include <sys/byteorder.h>
#include <sys/list.h>
-#include <sys/uio_impl.h>
#include <sys/time.h>
#include <sys/zone.h>
#include <sys/kstat.h>
@@ -61,11 +59,8 @@
#include <sys/disp.h>
#include <sys/trace.h>
#include <sys/procfs_list.h>
-#include <linux/dcache_compat.h>
-#include <linux/utsname_compat.h>
#include <sys/mod.h>
-#include <sys/sysmacros.h>
-
+#include <sys/zfs_context_os.h>
#else /* _KERNEL */
#define _SYS_MUTEX_H
@@ -88,7 +83,6 @@
#include <pthread.h>
#include <setjmp.h>
#include <assert.h>
-#include <alloca.h>
#include <umem.h>
#include <limits.h>
#include <atomic.h>
@@ -101,7 +95,6 @@
#include <sys/types.h>
#include <sys/cred.h>
#include <sys/sysmacros.h>
-#include <sys/bitmap.h>
#include <sys/resource.h>
#include <sys/byteorder.h>
#include <sys/list.h>
@@ -117,6 +110,8 @@
#include <sys/utsname.h>
#include <sys/trace_zfs.h>
+#include <sys/zfs_context_os.h>
+
/*
* Stack
*/
@@ -333,15 +328,7 @@ extern void cv_broadcast(kcondvar_t *cv);
*/
#define tsd_get(k) pthread_getspecific(k)
#define tsd_set(k, v) pthread_setspecific(k, v)
-#define tsd_create(kp, d) pthread_key_create(kp, d)
-#define tsd_destroy(kp) /* nothing */
-
-/*
- * Thread-specific data
- */
-#define tsd_get(k) pthread_getspecific(k)
-#define tsd_set(k, v) pthread_setspecific(k, v)
-#define tsd_create(kp, d) pthread_key_create(kp, d)
+#define tsd_create(kp, d) pthread_key_create((pthread_key_t *)kp, d)
#define tsd_destroy(kp) /* nothing */
/*
@@ -562,7 +549,6 @@ typedef struct vsecattr {
size_t vsa_aclentsz; /* ACE size in bytes of vsa_aclentp */
} vsecattr_t;
-#define AT_TYPE 0x00001
#define AT_MODE 0x00002
#define AT_UID 0x00004
#define AT_GID 0x00008