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 -1
View File
@@ -1,4 +1,4 @@
SUBDIRS = linux sys
SUBDIRS = linux spl sys
COMMON_H = \
$(top_srcdir)/include/zfeature_common.h \
+2 -1
View File
@@ -10,7 +10,8 @@ KERNEL_H = \
$(top_srcdir)/include/linux/simd_x86.h \
$(top_srcdir)/include/linux/simd_aarch64.h \
$(top_srcdir)/include/linux/mod_compat.h \
$(top_srcdir)/include/linux/page_compat.h
$(top_srcdir)/include/linux/page_compat.h \
$(top_srcdir)/include/linux/compiler_compat.h
USER_H =
+1
View File
@@ -32,6 +32,7 @@
#include <linux/blkdev.h>
#include <linux/elevator.h>
#include <linux/backing-dev.h>
#include <linux/hdreg.h>
#ifndef HAVE_FMODE_T
typedef unsigned __bitwise__ fmode_t;
+35
View File
@@ -0,0 +1,35 @@
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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 (C) 2018 Lawrence Livermore National Security, LLC.
*/
#ifndef _ZFS_COMPILER_COMPAT_H
#define _ZFS_COMPILER_COMPAT_H
#include <linux/compiler.h>
#if !defined(READ_ONCE)
#define READ_ONCE(x) ACCESS_ONCE(x)
#endif
#endif /* _ZFS_COMPILER_COMPAT_H */
+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 */
+1
View File
@@ -42,6 +42,7 @@ COMMON_H = \
$(top_srcdir)/include/sys/mmp.h \
$(top_srcdir)/include/sys/mntent.h \
$(top_srcdir)/include/sys/multilist.h \
$(top_srcdir)/include/sys/note.h \
$(top_srcdir)/include/sys/nvpair.h \
$(top_srcdir)/include/sys/nvpair_impl.h \
$(top_srcdir)/include/sys/pathname.h \
+1 -2
View File
@@ -27,7 +27,6 @@
#define _ABD_H
#include <sys/isa_defs.h>
#include <sys/int_types.h>
#include <sys/debug.h>
#include <sys/refcount.h>
#ifdef _KERNEL
@@ -116,7 +115,7 @@ int abd_cmp(abd_t *, abd_t *);
int abd_cmp_buf_off(abd_t *, const void *, size_t, size_t);
void abd_zero_off(abd_t *, size_t, size_t);
#if defined(_KERNEL) && defined(HAVE_SPL)
#if defined(_KERNEL)
unsigned int abd_scatter_bio_map_off(struct bio *, abd_t *, unsigned int,
size_t);
unsigned long abd_nr_pages_off(abd_t *, unsigned int, size_t);
-1
View File
@@ -31,7 +31,6 @@ extern "C" {
#endif
#ifdef _KERNEL
#include <sys/varargs.h>
#include <sys/nvpair.h>
#else
#include <libnvpair.h>
+56
View File
@@ -0,0 +1,56 @@
/*
* 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 (c) 1994 by Sun Microsystems, Inc.
*/
/*
* sys/note.h: interface for annotating source with info for tools
*
* This is the underlying interface; NOTE (/usr/include/note.h) is the
* preferred interface, but all exported header files should include this
* file directly and use _NOTE so as not to take "NOTE" from the user's
* namespace. For consistency, *all* kernel source should use _NOTE.
*
* By default, annotations expand to nothing. This file implements
* that. Tools using annotations will interpose a different version
* of this file that will expand annotations as needed.
*/
#ifndef _SYS_NOTE_H
#define _SYS_NOTE_H
#ifdef __cplusplus
extern "C" {
#endif
#ifndef _NOTE
#define _NOTE(s)
#endif
#define NOTE(s) _NOTE(s)
#ifdef __cplusplus
}
#endif
#endif /* _SYS_NOTE_H */
+1 -6
View File
@@ -29,11 +29,6 @@
#include <sys/types.h>
#include <sys/time.h>
#include <sys/errno.h>
#include <sys/va_list.h>
#if defined(_KERNEL) && !defined(_BOOT)
#include <sys/kmem.h>
#endif
#ifdef __cplusplus
extern "C" {
@@ -142,7 +137,7 @@ struct nv_alloc_ops {
extern const nv_alloc_ops_t *nv_fixed_ops;
extern nv_alloc_t *nv_alloc_nosleep;
#if defined(_KERNEL) && !defined(_BOOT)
#if defined(_KERNEL)
extern nv_alloc_t *nv_alloc_sleep;
extern nv_alloc_t *nv_alloc_pushpage;
#endif
+1
View File
@@ -40,6 +40,7 @@
#define _SYS_XVATTR_H
#include <sys/vnode.h>
#include <sys/strings.h>
#define AV_SCANSTAMP_SZ 32 /* length of anti-virus scanstamp */
+3 -11
View File
@@ -32,31 +32,25 @@
#include <sys/note.h>
#include <sys/types.h>
#include <sys/t_lock.h>
#include <sys/atomic.h>
#include <sys/sysmacros.h>
#include <sys/bitmap.h>
#include <sys/vmsystm.h>
#include <sys/condvar.h>
#include <sys/cmn_err.h>
#include <sys/kmem.h>
#include <sys/kmem_cache.h>
#include <sys/vmem.h>
#include <sys/taskq.h>
#include <sys/buf.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/cpuvar.h>
#include <sys/kobj.h>
#include <sys/conf.h>
#include <sys/disp.h>
#include <sys/debug.h>
#include <sys/random.h>
#include <sys/strings.h>
#include <sys/byteorder.h>
#include <sys/systm.h>
#include <sys/list.h>
#include <sys/uio_impl.h>
#include <sys/dirent.h>
#include <sys/time.h>
#include <vm/seg_kmem.h>
#include <sys/zone.h>
#include <sys/sdt.h>
#include <sys/kstat.h>
@@ -76,8 +70,6 @@
#define _SYS_MUTEX_H
#define _SYS_RWLOCK_H
#define _SYS_CONDVAR_H
#define _SYS_SYSTM_H
#define _SYS_T_LOCK_H
#define _SYS_VNODE_H
#define _SYS_VFS_H
#define _SYS_SUNDDI_H
+1 -1
View File
@@ -22,7 +22,7 @@
#ifndef _SYS_FS_ZFS_DELAY_H
#define _SYS_FS_ZFS_DELAY_H
#include <linux/delay_compat.h>
#include <sys/timer.h>
/*
* Generic wrapper to sleep until a given time.
-1
View File
@@ -27,7 +27,6 @@
#define _SYS_FS_ZFS_FUID_H
#ifdef _KERNEL
#include <sys/kidmap.h>
#include <sys/sid.h>
#include <sys/dmu.h>
#include <sys/zfs_vfsops.h>
-1
View File
@@ -30,7 +30,6 @@
#ifdef _KERNEL
#include <sys/isa_defs.h>
#include <sys/types32.h>
#include <sys/attr.h>
#include <sys/list.h>
#include <sys/dmu.h>
#include <sys/sa.h>
-1
View File
@@ -31,7 +31,6 @@
#include <linux/dcache_compat.h>
#include <linux/exportfs.h>
#include <linux/falloc.h>
#include <linux/file_compat.h>
#include <linux/parser.h>
#include <linux/task_io_accounting_ops.h>
#include <linux/vfs_compat.h>