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
+4 -16
View File
@@ -27,7 +27,6 @@
#include <sys/kmem.h>
#include <sys/vmem.h>
#include <linux/mm.h>
#include <linux/ratelimit.h>
/*
* As a general rule kmem_alloc() allocations should be small, preferably
@@ -134,12 +133,6 @@ strfree(char *str)
}
EXPORT_SYMBOL(strfree);
/*
* Limit the number of large allocation stack traces dumped to not more than
* 5 every 60 seconds to prevent denial-of-service attacks from debug code.
*/
DEFINE_RATELIMIT_STATE(kmem_alloc_ratelimit_state, 60 * HZ, 5);
/*
* General purpose unified implementation of kmem_alloc(). It is an
* amalgamation of Linux and Illumos allocator design. It should never be
@@ -160,7 +153,7 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
* through the vmem_alloc()/vmem_zalloc() interfaces.
*/
if ((spl_kmem_alloc_warn > 0) && (size > spl_kmem_alloc_warn) &&
!(flags & KM_VMEM) && __ratelimit(&kmem_alloc_ratelimit_state)) {
!(flags & KM_VMEM)) {
printk(KERN_WARNING
"Large kmem_alloc(%lu, 0x%x), please file an issue at:\n"
"https://github.com/zfsonlinux/zfs/issues/new\n",
@@ -207,14 +200,6 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
continue;
}
if (unlikely(__ratelimit(&kmem_alloc_ratelimit_state))) {
printk(KERN_WARNING
"Possible memory allocation deadlock: "
"size=%lu lflags=0x%x",
(unsigned long)size, lflags);
dump_stack();
}
/*
* Use cond_resched() instead of congestion_wait() to avoid
* deadlocking systems where there are no block devices.
@@ -535,9 +520,12 @@ spl_kmem_fini_tracking(struct list_head *list, spinlock_t *lock)
int
spl_kmem_init(void)
{
#ifdef DEBUG_KMEM
kmem_alloc_used_set(0);
#ifdef DEBUG_KMEM_TRACKING
spl_kmem_init_tracking(&kmem_list, &kmem_lock, KMEM_TABLE_SIZE);
#endif /* DEBUG_KMEM_TRACKING */