Skip to content

Commit 93ce2b4

Browse files
committed
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
1 parent 1272941 commit 93ce2b4

File tree

209 files changed

+1096
-1164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+1096
-1164
lines changed

AUTHORS

+299-90
Large diffs are not rendered by default.

COPYRIGHT

+17-29
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,27 @@
1-
The majority of the code in the ZFS on Linux port comes from OpenSolaris
2-
which has been released under the terms of the CDDL open source license.
3-
This includes the core ZFS code, libavl, libnvpair, libefi, libunicode,
4-
and libutil. The original OpenSolaris source can be downloaded from:
5-
6-
http://dlc.sun.com/osol/on/downloads/b121/on-src.tar.bz2
7-
8-
Files which do not originate from OpenSolaris are noted in the file header
9-
and attributed properly. These exceptions include, but are not limited
10-
to, the vdev_disk.c and zvol.c implementation which are licensed under
11-
the CDDL.
12-
13-
The latest stable and development versions of this port can be downloaded
14-
from the official ZFS on Linux site located at:
1+
Refer to the git commit log for authoritative copyright attribution.
152

16-
http://zfsonlinux.org/
3+
The original ZFS source code was obtained from Open Solaris which was
4+
released under the terms of the CDDL open source license. Additional
5+
changes have been included from OpenZFS and the Illumos project which
6+
are similarly licensed. These projects can be found on Github at:
177

18-
This ZFS on Linux port was produced at the Lawrence Livermore National
19-
Laboratory (LLNL) under Contract No. DE-AC52-07NA27344 (Contract 44)
20-
between the U.S. Department of Energy (DOE) and Lawrence Livermore
21-
National Security, LLC (LLNS) for the operation of LLNL. It has been
22-
approved for release under LLNL-CODE-403049.
8+
* https://github.com/illumos/illumos-gate
9+
* https://github.com/openzfs/openzfs
2310

2411
Unless otherwise noted, all files in this distribution are released
2512
under the Common Development and Distribution License (CDDL).
26-
Exceptions are noted within the associated source files. A few notable
27-
exceptions and their respective licenses include:
2813

29-
Skein Checksum Implementation: module/icp/algs/skein/THIRDPARTYLICENSE
30-
AES Implementation: module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
31-
AES Implementation: module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
32-
PBKDF2 Implementation: lib/libzfs/THIRDPARTYLICENSE.openssl
14+
Exceptions are noted within the associated source files headers and
15+
by including a THIRDPARTYLICENSE file with the license terms. A few
16+
notable exceptions and their respective licenses include:
17+
18+
* Skein Checksum Implementation: module/icp/algs/skein/THIRDPARTYLICENSE
19+
* AES Implementation: module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.gladman
20+
* AES Implementation: module/icp/asm-x86_64/aes/THIRDPARTYLICENSE.openssl
21+
* PBKDF2 Implementation: lib/libzfs/THIRDPARTYLICENSE.openssl
22+
* SPL Implementation: module/spl/THIRDPARTYLICENSE.gplv2
3323

3424
This product includes software developed by the OpenSSL Project for use
3525
in the OpenSSL Toolkit (http://www.openssl.org/)
3626

37-
See the file OPENSOLARIS.LICENSE for more information.
38-
39-
Refer to the git commit log for authoritative copyright attribution.
27+
See the LICENSE and NOTICE for more information.

DISCLAIMER

-24
This file was deleted.
File renamed without changes.

Makefile.am

+19-3
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ endif
1111
if CONFIG_KERNEL
1212
SUBDIRS += module
1313

14-
extradir = @prefix@/src/zfs-$(VERSION)
14+
extradir = $(prefix)/src/zfs-$(VERSION)
1515
extra_HEADERS = zfs.release.in zfs_config.h.in
1616

17-
kerneldir = @prefix@/src/zfs-$(VERSION)/$(LINUX_VERSION)
17+
kerneldir = $(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION)
1818
nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
1919
endif
2020

2121
AUTOMAKE_OPTIONS = foreign
2222
EXTRA_DIST = autogen.sh copy-builtin
2323
EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
24-
EXTRA_DIST += META DISCLAIMER COPYRIGHT README.markdown OPENSOLARIS.LICENSE
24+
EXTRA_DIST += META AUTHORS COPYRIGHT LICENSE NOTICE README.md
2525

2626
@CODE_COVERAGE_RULES@
2727

@@ -44,6 +44,22 @@ dist-hook:
4444
sed -i 's/Release:[[:print:]]*/Release: $(RELEASE)/' \
4545
$(distdir)/META
4646

47+
# For compatibility, create a matching spl-x.y.z directly which contains
48+
# symlinks to the updated header and object file locations. These
49+
# compatibility links will be removed in the next major release.
50+
if CONFIG_KERNEL
51+
install-data-hook:
52+
mkdir $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
53+
cd $(DESTDIR)$(prefix)/src/spl-$(VERSION) && \
54+
ln -s ../zfs-$(VERSION)/include/spl include && \
55+
ln -s ../zfs-$(VERSION)/$(LINUX_VERSION) $(LINUX_VERSION) && \
56+
ln -s ../zfs-$(VERSION)/zfs_config.h.in spl_config.h.in && \
57+
ln -s ../zfs-$(VERSION)/zfs.release.in spl.release.in && \
58+
cd $(DESTDIR)$(prefix)/src/zfs-$(VERSION)/$(LINUX_VERSION) && \
59+
ln -s zfs_config.h spl_config.h && \
60+
ln -s zfs.release spl.release
61+
endif
62+
4763
checkstyle: cstyle shellcheck flake8 commitcheck mancheck testscheck
4864

4965
commitcheck:

NOTICE

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
This work was produced under the auspices of the U.S. Department of Energy by
2+
Lawrence Livermore National Laboratory under Contract DE-AC52-07NA27344.
3+
4+
This work was prepared as an account of work sponsored by an agency of the
5+
United States Government. Neither the United States Government nor Lawrence
6+
Livermore National Security, LLC, nor any of their employees makes any warranty,
7+
expressed or implied, or assumes any legal liability or responsibility for the
8+
accuracy, completeness, or usefulness of any information, apparatus, product, or
9+
process disclosed, or represents that its use would not infringe privately owned
10+
rights. Reference herein to any specific commercial product, process, or service
11+
by trade name, trademark, manufacturer, or otherwise does not necessarily
12+
constitute or imply its endorsement, recommendation, or favoring by the United
13+
States Government or Lawrence Livermore National Security, LLC. The views and
14+
opinions of authors expressed herein do not necessarily state or reflect those
15+
of the United States Government or Lawrence Livermore National Security, LLC,
16+
and shall not be used for advertising or product endorsement purposes.

README.markdown renamed to README.md

+8
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,22 @@ developed for Solaris and is now maintained by the OpenZFS community.
77
[![coverity](https://scan.coverity.com/projects/1973/badge.svg)](https://scan.coverity.com/projects/zfsonlinux-zfs)
88

99
# Official Resources
10+
1011
* [Site](http://zfsonlinux.org)
1112
* [Wiki](https://github.com/zfsonlinux/zfs/wiki)
1213
* [Mailing lists](https://github.com/zfsonlinux/zfs/wiki/Mailing-Lists)
1314
* [OpenZFS site](http://open-zfs.org/)
1415

1516
# Installation
17+
1618
Full documentation for installing ZoL on your favorite Linux distribution can
1719
be found at [our site](http://zfsonlinux.org/).
1820

1921
# Contribute & Develop
22+
2023
We have a separate document with [contribution guidelines](./.github/CONTRIBUTING.md).
24+
25+
# Release
26+
27+
ZFS on Linux is released under a CDDL license.
28+
For more details see the NOTICE, LICENSE and COPYRIGHT files; `UCRL-CODE-235197`

TEST

-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
#TEST_PREPARE_WATCHDOG="yes"
55
#TEST_PREPARE_SHARES="yes"
66

7-
### SPLAT
8-
#TEST_SPLAT_SKIP="yes"
9-
#TEST_SPLAT_OPTIONS="-acvx"
10-
117
### ztest
128
#TEST_ZTEST_SKIP="yes"
139
#TEST_ZTEST_TIMEOUT=1800

cmd/mount_zfs/mount_zfs.c

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include <locale.h>
3535
#include <getopt.h>
3636
#include <fcntl.h>
37+
#include <errno.h>
3738

3839
#define ZS_COMMENT 0x00000000 /* comment */
3940
#define ZS_ZFSUTIL 0x00000001 /* caller is zfs(8) */

cmd/zed/agents/zfs_diagnosis.c

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
*/
2727

2828
#include <stddef.h>
29+
#include <string.h>
2930
#include <strings.h>
3031
#include <libuutil.h>
3132
#include <libzfs.h>

cmd/zed/agents/zfs_mod.c

+1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
#include <thread_pool.h>
8686
#include <pthread.h>
8787
#include <unistd.h>
88+
#include <errno.h>
8889
#include "zfs_agents.h"
8990
#include "../zed_log.h"
9091

cmd/zfs/zfs_iter.c

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include <stddef.h>
3232
#include <stdio.h>
3333
#include <stdlib.h>
34+
#include <string.h>
3435
#include <strings.h>
3536

3637
#include <libzfs.h>

config/kernel-ctl-table-name.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ dnl #
22
dnl # 2.6.33 API change,
33
dnl # Removed .ctl_name from struct ctl_table.
44
dnl #
5-
AC_DEFUN([SPL_AC_CTL_NAME], [
5+
AC_DEFUN([ZFS_AC_KERNEL_CTL_NAME], [
66
AC_MSG_CHECKING([whether struct ctl_table has ctl_name])
7-
SPL_LINUX_TRY_COMPILE([
7+
ZFS_LINUX_TRY_COMPILE([
88
#include <linux/sysctl.h>
99
],[
1010
struct ctl_table ctl __attribute__ ((unused));

config/kernel-fallocate-pax.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
dnl #
22
dnl # PaX Linux 2.6.38 - 3.x API
33
dnl #
4-
AC_DEFUN([SPL_AC_PAX_KERNEL_FILE_FALLOCATE], [
4+
AC_DEFUN([ZFS_AC_PAX_KERNEL_FILE_FALLOCATE], [
55
AC_MSG_CHECKING([whether fops->fallocate() exists])
6-
SPL_LINUX_TRY_COMPILE([
6+
ZFS_LINUX_TRY_COMPILE([
77
#include <linux/fs.h>
88
],[
99
long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;

config/kernel-group-info.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ dnl #
22
dnl # 4.9 API change
33
dnl # group_info changed from 2d array via >blocks to 1d array via ->gid
44
dnl #
5-
AC_DEFUN([SPL_AC_GROUP_INFO_GID], [
5+
AC_DEFUN([ZFS_AC_KERNEL_GROUP_INFO_GID], [
66
AC_MSG_CHECKING([whether group_info->gid exists])
77
tmp_flags="$EXTRA_KCFLAGS"
88
EXTRA_KCFLAGS="-Werror"
9-
SPL_LINUX_TRY_COMPILE([
9+
ZFS_LINUX_TRY_COMPILE([
1010
#include <linux/cred.h>
1111
],[
1212
struct group_info *gi = groups_alloc(1);

config/kernel-inode-lock.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ dnl # i_mutex is changed to i_rwsem. Instead of directly using
44
dnl # i_mutex/i_rwsem, we should use inode_lock() and inode_lock_shared()
55
dnl # We test inode_lock_shared because inode_lock is introduced earlier.
66
dnl #
7-
AC_DEFUN([SPL_AC_INODE_LOCK], [
7+
AC_DEFUN([ZFS_AC_KERNEL_INODE_LOCK], [
88
AC_MSG_CHECKING([whether inode_lock_shared() exists])
99
tmp_flags="$EXTRA_KCFLAGS"
1010
EXTRA_KCFLAGS="-Werror"
11-
SPL_LINUX_TRY_COMPILE([
11+
ZFS_LINUX_TRY_COMPILE([
1212
#include <linux/fs.h>
1313
],[
1414
struct inode *inode = NULL;

config/kernel-kmem-cache.m4

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ dnl # private allocation flags which are applied when allocating a new slab
55
dnl # in kmem_getpages(). Unfortunately there is no public API for setting
66
dnl # non-default flags.
77
dnl #
8-
AC_DEFUN([SPL_AC_KMEM_CACHE_ALLOCFLAGS], [
8+
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_ALLOCFLAGS], [
99
AC_MSG_CHECKING([whether struct kmem_cache has allocflags])
10-
SPL_LINUX_TRY_COMPILE([
10+
ZFS_LINUX_TRY_COMPILE([
1111
#include <linux/slab.h>
1212
],[
1313
struct kmem_cache cachep __attribute__ ((unused));
@@ -20,7 +20,7 @@ AC_DEFUN([SPL_AC_KMEM_CACHE_ALLOCFLAGS], [
2020
AC_MSG_RESULT(no)
2121
2222
AC_MSG_CHECKING([whether struct kmem_cache has gfpflags])
23-
SPL_LINUX_TRY_COMPILE([
23+
ZFS_LINUX_TRY_COMPILE([
2424
#include <linux/slab.h>
2525
],[
2626
struct kmem_cache cachep __attribute__ ((unused));
@@ -40,11 +40,11 @@ dnl # grsecurity API change,
4040
dnl # kmem_cache_create() with SLAB_USERCOPY flag replaced by
4141
dnl # kmem_cache_create_usercopy().
4242
dnl #
43-
AC_DEFUN([SPL_AC_KMEM_CACHE_CREATE_USERCOPY], [
43+
AC_DEFUN([ZFS_AC_KERNEL_KMEM_CACHE_CREATE_USERCOPY], [
4444
AC_MSG_CHECKING([whether kmem_cache_create_usercopy() exists])
4545
tmp_flags="$EXTRA_KCFLAGS"
4646
EXTRA_KCFLAGS="-Werror"
47-
SPL_LINUX_TRY_COMPILE([
47+
ZFS_LINUX_TRY_COMPILE([
4848
#include <linux/slab.h>
4949
static void ctor(void *foo)
5050
{

config/kernel-kuidgid.m4

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ dnl # User namespaces, use kuid_t in place of uid_t
33
dnl # where available. Not strictly a user namespaces thing
44
dnl # but it should prevent surprises
55
dnl #
6-
AC_DEFUN([SPL_AC_KUIDGID_T], [
6+
AC_DEFUN([ZFS_AC_KERNEL_KUIDGID_T], [
77
AC_MSG_CHECKING([whether kuid_t/kgid_t is available])
8-
SPL_LINUX_TRY_COMPILE([
8+
ZFS_LINUX_TRY_COMPILE([
99
#include <linux/uidgid.h>
1010
], [
11-
kuid_t userid = KUIDT_INIT(0);
12-
kgid_t groupid = KGIDT_INIT(0);
11+
kuid_t userid __attribute__ ((unused)) = KUIDT_INIT(0);
12+
kgid_t groupid __attribute__ ((unused)) = KGIDT_INIT(0);
1313
],[
14-
SPL_LINUX_TRY_COMPILE([
14+
ZFS_LINUX_TRY_COMPILE([
1515
#include <linux/uidgid.h>
1616
], [
17-
kuid_t userid = 0;
18-
kgid_t groupid = 0;
17+
kuid_t userid __attribute__ ((unused)) = 0;
18+
kgid_t groupid __attribute__ ((unused)) = 0;
1919
],[
2020
AC_MSG_RESULT(yes; optional)
2121
],[

config/kernel-pde-data.m4

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ dnl #
22
dnl # 3.10 API change,
33
dnl # PDE is replaced by PDE_DATA
44
dnl #
5-
AC_DEFUN([SPL_AC_PDE_DATA], [
5+
AC_DEFUN([ZFS_AC_KERNEL_PDE_DATA], [
66
AC_MSG_CHECKING([whether PDE_DATA() is available])
7-
SPL_LINUX_TRY_COMPILE_SYMBOL([
7+
ZFS_LINUX_TRY_COMPILE_SYMBOL([
88
#include <linux/proc_fs.h>
99
], [
1010
PDE_DATA(NULL);

config/kernel-rw.m4

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ dnl # 4.14 API change
33
dnl # kernel_write() which was introduced in 3.9 was updated to take
44
dnl # the offset as a pointer which is needed by vn_rdwr().
55
dnl #
6-
AC_DEFUN([SPL_AC_KERNEL_WRITE], [
6+
AC_DEFUN([ZFS_AC_KERNEL_WRITE], [
77
AC_MSG_CHECKING([whether kernel_write() takes loff_t pointer])
88
tmp_flags="$EXTRA_KCFLAGS"
99
EXTRA_KCFLAGS="-Werror"
10-
SPL_LINUX_TRY_COMPILE([
10+
ZFS_LINUX_TRY_COMPILE([
1111
#include <linux/fs.h>
1212
],[
1313
struct file *file = NULL;
@@ -32,11 +32,11 @@ dnl # 4.14 API change
3232
dnl # kernel_read() which has existed for forever was updated to take
3333
dnl # the offset as a pointer which is needed by vn_rdwr().
3434
dnl #
35-
AC_DEFUN([SPL_AC_KERNEL_READ], [
35+
AC_DEFUN([ZFS_AC_KERNEL_READ], [
3636
AC_MSG_CHECKING([whether kernel_read() takes loff_t pointer])
3737
tmp_flags="$EXTRA_KCFLAGS"
3838
EXTRA_KCFLAGS="-Werror"
39-
SPL_LINUX_TRY_COMPILE([
39+
ZFS_LINUX_TRY_COMPILE([
4040
#include <linux/fs.h>
4141
],[
4242
struct file *file = NULL;

0 commit comments

Comments
 (0)