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 <hutter2@llnl.gov>
Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Matthew Ahrens <mahrens@delphix.com>
Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
TEST_ZIMPORT_SKIP="yes"
Closes #7556
This commit is contained in:
Brian Behlendorf
2018-02-15 17:53:18 -08:00
parent 1272941f49
commit 93ce2b4ca5
209 changed files with 1096 additions and 1164 deletions
+1
View File
@@ -0,0 +1 @@
SUBDIRS = rpc sys
+7
View File
@@ -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
+61
View File
@@ -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
-2
View File
@@ -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)
+47
View File
@@ -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 */
+2 -1
View File
@@ -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))
+1
View File
@@ -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)
-1
View File
@@ -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
+2 -2
View File
@@ -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 {
+2 -2
View File
@@ -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 */