aboutsummaryrefslogtreecommitdiffstats
path: root/include/spl
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2018-02-15 17:53:18 -0800
committerBrian Behlendorf <[email protected]>2018-05-29 16:00:33 -0700
commit93ce2b4ca5a40c41ac945cd3aaf4a4a22bb751e1 (patch)
tree6832f5c9dfdbe0f0bd5c8708344a769676b1f95d /include/spl
parent1272941f49321bcb7b26025670720c98785427ee (diff)
Update build system and packaging
Minimal changes required to integrate the SPL sources in to the ZFS repository build infrastructure and packaging. Build system and packaging: * Renamed SPL_* autoconf m4 macros to ZFS_*. * Removed redundant SPL_* autoconf m4 macros. * Updated the RPM spec files to remove SPL package dependency. * The zfs package obsoletes the spl package, and the zfs-kmod package obsoletes the spl-kmod package. * The zfs-kmod-devel* packages were updated to add compatibility symlinks under /usr/src/spl-x.y.z until all dependent packages can be updated. They will be removed in a future release. * Updated copy-builtin script for in-kernel builds. * Updated DKMS package to include the spl.ko. * Updated stale AUTHORS file to include all contributors. * Updated stale COPYRIGHT and included the SPL as an exception. * Renamed README.markdown to README.md * Renamed OPENSOLARIS.LICENSE to LICENSE. * Renamed DISCLAIMER to NOTICE. Required code changes: * Removed redundant HAVE_SPL macro. * Removed _BOOT from nvpairs since it doesn't apply for Linux. * Initial header cleanup (removal of empty headers, refactoring). * Remove SPL repository clone/build from zimport.sh. * Use of DEFINE_RATELIMIT_STATE and DEFINE_SPINLOCK removed due to build issues when forcing C99 compilation. * Replaced legacy ACCESS_ONCE with READ_ONCE. * Include needed headers for `current` and `EXPORT_SYMBOL`. Reviewed-by: Tony Hutter <[email protected]> Reviewed-by: Olaf Faaland <[email protected]> Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Pavel Zakharov <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> TEST_ZIMPORT_SKIP="yes" Closes #7556
Diffstat (limited to 'include/spl')
-rw-r--r--include/spl/Makefile.am1
-rw-r--r--include/spl/rpc/Makefile.am7
-rw-r--r--include/spl/sys/Makefile.am61
-rw-r--r--include/spl/sys/debug.h2
-rw-r--r--include/spl/sys/errno.h47
-rw-r--r--include/spl/sys/mutex.h3
-rw-r--r--include/spl/sys/rwlock.h1
-rw-r--r--include/spl/sys/sysmacros.h1
-rw-r--r--include/spl/sys/types.h4
-rw-r--r--include/spl/sys/vnode.h4
10 files changed, 123 insertions, 8 deletions
diff --git a/include/spl/Makefile.am b/include/spl/Makefile.am
new file mode 100644
index 000000000..bd781c08f
--- /dev/null
+++ b/include/spl/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = rpc sys
diff --git a/include/spl/rpc/Makefile.am b/include/spl/rpc/Makefile.am
new file mode 100644
index 000000000..5110cc0f0
--- /dev/null
+++ b/include/spl/rpc/Makefile.am
@@ -0,0 +1,7 @@
+KERNEL_H = \
+ $(top_srcdir)/include/spl/rpc/xdr.h
+
+if CONFIG_KERNEL
+kerneldir = @prefix@/src/zfs-$(VERSION)/include/spl/rpc
+kernel_HEADERS = $(KERNEL_H)
+endif
diff --git a/include/spl/sys/Makefile.am b/include/spl/sys/Makefile.am
new file mode 100644
index 000000000..d58ed0e20
--- /dev/null
+++ b/include/spl/sys/Makefile.am
@@ -0,0 +1,61 @@
+KERNEL_H = \
+ $(top_srcdir)/include/spl/sys/acl.h \
+ $(top_srcdir)/include/spl/sys/atomic.h \
+ $(top_srcdir)/include/spl/sys/byteorder.h \
+ $(top_srcdir)/include/spl/sys/callb.h \
+ $(top_srcdir)/include/spl/sys/callo.h \
+ $(top_srcdir)/include/spl/sys/cmn_err.h \
+ $(top_srcdir)/include/spl/sys/condvar.h \
+ $(top_srcdir)/include/spl/sys/console.h \
+ $(top_srcdir)/include/spl/sys/cred.h \
+ $(top_srcdir)/include/spl/sys/ctype.h \
+ $(top_srcdir)/include/spl/sys/debug.h \
+ $(top_srcdir)/include/spl/sys/disp.h \
+ $(top_srcdir)/include/spl/sys/dkioc_free_util.h \
+ $(top_srcdir)/include/spl/sys/dkio.h \
+ $(top_srcdir)/include/spl/sys/errno.h \
+ $(top_srcdir)/include/spl/sys/fcntl.h \
+ $(top_srcdir)/include/spl/sys/file.h \
+ $(top_srcdir)/include/spl/sys/inttypes.h \
+ $(top_srcdir)/include/spl/sys/isa_defs.h \
+ $(top_srcdir)/include/spl/sys/kmem_cache.h \
+ $(top_srcdir)/include/spl/sys/kmem.h \
+ $(top_srcdir)/include/spl/sys/kobj.h \
+ $(top_srcdir)/include/spl/sys/kstat.h \
+ $(top_srcdir)/include/spl/sys/list.h \
+ $(top_srcdir)/include/spl/sys/mode.h \
+ $(top_srcdir)/include/spl/sys/mutex.h \
+ $(top_srcdir)/include/spl/sys/param.h \
+ $(top_srcdir)/include/spl/sys/processor.h \
+ $(top_srcdir)/include/spl/sys/proc.h \
+ $(top_srcdir)/include/spl/sys/random.h \
+ $(top_srcdir)/include/spl/sys/rwlock.h \
+ $(top_srcdir)/include/spl/sys/shrinker.h \
+ $(top_srcdir)/include/spl/sys/sid.h \
+ $(top_srcdir)/include/spl/sys/signal.h \
+ $(top_srcdir)/include/spl/sys/stat.h \
+ $(top_srcdir)/include/spl/sys/strings.h \
+ $(top_srcdir)/include/spl/sys/sunddi.h \
+ $(top_srcdir)/include/spl/sys/sysmacros.h \
+ $(top_srcdir)/include/spl/sys/systeminfo.h \
+ $(top_srcdir)/include/spl/sys/taskq.h \
+ $(top_srcdir)/include/spl/sys/thread.h \
+ $(top_srcdir)/include/spl/sys/time.h \
+ $(top_srcdir)/include/spl/sys/timer.h \
+ $(top_srcdir)/include/spl/sys/tsd.h \
+ $(top_srcdir)/include/spl/sys/types32.h \
+ $(top_srcdir)/include/spl/sys/types.h \
+ $(top_srcdir)/include/spl/sys/uio.h \
+ $(top_srcdir)/include/spl/sys/user.h \
+ $(top_srcdir)/include/spl/sys/vfs.h \
+ $(top_srcdir)/include/spl/sys/vmem.h \
+ $(top_srcdir)/include/spl/sys/vmsystm.h \
+ $(top_srcdir)/include/spl/sys/vnode.h \
+ $(top_srcdir)/include/spl/sys/wait.h \
+ $(top_srcdir)/include/spl/sys/zmod.h \
+ $(top_srcdir)/include/spl/sys/zone.h
+
+if CONFIG_KERNEL
+kerneldir = @prefix@/src/zfs-$(VERSION)/include/spl/sys
+kernel_HEADERS = $(KERNEL_H)
+endif
diff --git a/include/spl/sys/debug.h b/include/spl/sys/debug.h
index a4a458066..692d6c61e 100644
--- a/include/spl/sys/debug.h
+++ b/include/spl/sys/debug.h
@@ -92,7 +92,6 @@ void spl_dumpstack(void);
*/
#ifdef NDEBUG
-#define SPL_DEBUG_STR ""
#define ASSERT(x) ((void)0)
#define ASSERTV(x)
#define ASSERT3B(x,y,z) ((void)0)
@@ -108,7 +107,6 @@ void spl_dumpstack(void);
*/
#else
-#define SPL_DEBUG_STR " (DEBUG mode)"
#define ASSERT(cond) VERIFY(cond)
#define ASSERTV(x) x
#define ASSERT3B(x,y,z) VERIFY3B(x, y, z)
diff --git a/include/spl/sys/errno.h b/include/spl/sys/errno.h
new file mode 100644
index 000000000..6015b1a3e
--- /dev/null
+++ b/include/spl/sys/errno.h
@@ -0,0 +1,47 @@
+/*
+ * 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
+ */
+/*
+ * Copyright 2000 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
+/* All Rights Reserved */
+
+/*
+ * University Copyright- Copyright (c) 1982, 1986, 1988
+ * The Regents of the University of California
+ * All Rights Reserved
+ *
+ * University Acknowledgment- Portions of this document are derived from
+ * software developed by the University of California, Berkeley, and its
+ * contributors.
+ */
+
+#ifndef _SYS_ERRNO_H
+#define _SYS_ERRNO_H
+
+#include <linux/errno.h>
+
+#define ENOTSUP EOPNOTSUPP
+
+#endif /* _SYS_ERRNO_H */
diff --git a/include/spl/sys/mutex.h b/include/spl/sys/mutex.h
index f906d49d4..ed0cd4932 100644
--- a/include/spl/sys/mutex.h
+++ b/include/spl/sys/mutex.h
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <linux/mutex.h>
#include <linux/lockdep.h>
+#include <linux/compiler_compat.h>
typedef enum {
MUTEX_DEFAULT = 0,
@@ -59,7 +60,7 @@ spl_mutex_clear_owner(kmutex_t *mp)
mp->m_owner = NULL;
}
-#define mutex_owner(mp) (ACCESS_ONCE((mp)->m_owner))
+#define mutex_owner(mp) (READ_ONCE((mp)->m_owner))
#define mutex_owned(mp) (mutex_owner(mp) == current)
#define MUTEX_HELD(mp) mutex_owned(mp)
#define MUTEX_NOT_HELD(mp) (!MUTEX_HELD(mp))
diff --git a/include/spl/sys/rwlock.h b/include/spl/sys/rwlock.h
index b44ceab66..088e28b44 100644
--- a/include/spl/sys/rwlock.h
+++ b/include/spl/sys/rwlock.h
@@ -27,6 +27,7 @@
#include <sys/types.h>
#include <linux/rwsem.h>
+#include <linux/sched.h>
/* Linux kernel compatibility */
#if defined(CONFIG_PREEMPT_RT_FULL)
diff --git a/include/spl/sys/sysmacros.h b/include/spl/sys/sysmacros.h
index 839e7fd8c..e4bd80aa1 100644
--- a/include/spl/sys/sysmacros.h
+++ b/include/spl/sys/sysmacros.h
@@ -79,7 +79,6 @@
#define max_ncpus num_possible_cpus()
#define boot_ncpus num_online_cpus()
#define CPU_SEQID smp_processor_id()
-#define _NOTE(x)
#define is_system_labeled() 0
#ifndef RLIM64_INFINITY
diff --git a/include/spl/sys/types.h b/include/spl/sys/types.h
index a5b478127..3bb3ed3e2 100644
--- a/include/spl/sys/types.h
+++ b/include/spl/sys/types.h
@@ -28,11 +28,11 @@
#include <linux/types.h>
#ifndef ULLONG_MAX
-#define ULLONG_MAX (~0ULL)
+#define ULLONG_MAX (~0ULL)
#endif
#ifndef LLONG_MAX
-#define LLONG_MAX ((long long)(~0ULL>>1))
+#define LLONG_MAX ((long long)(~0ULL>>1))
#endif
typedef enum {
diff --git a/include/spl/sys/vnode.h b/include/spl/sys/vnode.h
index a3f7828e7..d3b903f13 100644
--- a/include/spl/sys/vnode.h
+++ b/include/spl/sys/vnode.h
@@ -86,7 +86,7 @@
#define AT_MTIME ATTR_MTIME
#define AT_CTIME ATTR_CTIME
-#define ATTR_XVATTR (1 << 31)
+#define ATTR_XVATTR (1U << 31)
#define AT_XVATTR ATTR_XVATTR
#define ATTR_IATTR_MASK (ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_SIZE | \
@@ -120,7 +120,7 @@ typedef enum vtype {
typedef struct vattr {
enum vtype va_type; /* vnode type */
- uint_t va_mask; /* attribute bit-mask */
+ uint32_t va_mask; /* attribute bit-mask */
ushort_t va_mode; /* acc mode */
uid_t va_uid; /* owner uid */
gid_t va_gid; /* owner gid */