diff --git a/Makefile.am b/Makefile.am index ebb385fabc06..0a73a63870bc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -170,6 +170,10 @@ flake8: echo "skipping flake8 because flake8 is not installed"; \ fi +PHONY += regen-tests +regen-tests: + @$(MAKE) -C tests/zfs-tests/tests regen + PHONY += ctags ctags: $(RM) tags diff --git a/autogen.sh b/autogen.sh index c817090183f1..319055ed919f 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,4 +1,5 @@ #!/bin/sh +# shellcheck disable=SC2016,SC2094 [ "${0%/*}" = "$0" ] || cd "${0%/*}" || exit # %reldir%/%canon_reldir% (%D%/%C%) only appeared in automake 1.14, but RHEL/CentOS 7 has 1.13.4 @@ -47,6 +48,7 @@ automake --version | awk '{print $NF; exit}' | ( roots="$(sed '/Makefile$/!d;/module/d;s:^\s*:./:;s:/Makefile::;/^\.$/d' configure.ac)" + OIFS="$IFS" IFS=" " for root in $roots; do @@ -57,6 +59,67 @@ automake --version | awk '{print $NF; exit}' | ( set -f # shellcheck disable=SC2086,SC2046 process_root . $(printf '!\n-path\n%s/*\n' $roots) + IFS="$OIFS" } autoreconf -fiv && rm -rf autom4te.cache + +# https://github.com/openzfs/zfs/issues/13459 +# https://bugs.debian.org/1011024 +# When including, EXTRA_DIST in false conditionals is skipped; we need to preprocess Makefile.in to unbreak this. +# The same happens to dist_man_MANS (DISTFILES -> DIST_COMMON -> am__DIST_COMMON -> dist_man_MANS). +# +# Shortcuts taken: +# * only the root Makefile.in is processed because it's the only one that does if, include; it takes too long to process this as-is (~0.3s) +# * only one level of :suff=suff allowed +{ + deverbol() { + type rollback > /dev/null 2>&1 && rollback + rm -f "$verbols" + } + + trap deverbol EXIT + verbols="$(mktemp)" + + parse_verbols() { + v="${v#\$\(}" + v="${v%\)}" + [ -z "$suff_bundle" ] && { + suff_bundle="${v#*:}" + [ "$suff_bundle" = "$v" ] && suff_bundle= || suff_bundle=":$suff_bundle" + } + v="${v%:*}" + } + + printf "%s\n" dist_man_MANS EXTRA_DIST > "$verbols" + while read -r v suff_bundle; do + parse_verbols + # Early exit buys back 0.43s here + awk -v v="$v" '($0 ~ ("^(@[A-Z_@]*@)?" v " =")),!/\\$/ {copying=1; print} copying && !/\\$/ {exit}' Makefile.in | + grep -o '$([^ )]*)' | + sed 's/$/ '"$suff_bundle"'/' + done < "$verbols" >> "$verbols" + sort "$verbols" | uniq | + while read -r v suff_bundle; do + parse_verbols + # And another 0.34s here + awk -v v="$v" ' + BEGIN { + printf "faux_" v "_faux := " + } + ($0 ~ ("^@[A-Z_@]*@" v " =")),!/\\$/ { + l = $0 + sub(/^@[A-Z_@]*@/, "", l) + sub("^" v " =", "", l) + sub(/\\$/, "", l) + printf "%s", l + copying = 1 + } + copying && !/\\$/ { + exit + } + ' Makefile.in + echo + echo "EXTRA_DIST += \$(faux_${v}_faux${suff_bundle})" + done >> Makefile.in +} diff --git a/cmd/zed/agents/zfs_mod.c b/cmd/zed/agents/zfs_mod.c index 59d8182c0b2e..17e47873ebb7 100644 --- a/cmd/zed/agents/zfs_mod.c +++ b/cmd/zed/agents/zfs_mod.c @@ -1073,7 +1073,7 @@ zfs_enum_pools(void *arg) * For now, each agent has its own libzfs instance */ int -zfs_slm_init() +zfs_slm_init(void) { if ((g_zfshdl = libzfs_init()) == NULL) return (-1); @@ -1099,7 +1099,7 @@ zfs_slm_init() } void -zfs_slm_fini() +zfs_slm_fini(void) { unavailpool_t *pool; pendingdev_t *device; diff --git a/cmd/zed/zed_disk_event.c b/cmd/zed/zed_disk_event.c index 52b80d8c4c93..c4ca5452354b 100644 --- a/cmd/zed/zed_disk_event.c +++ b/cmd/zed/zed_disk_event.c @@ -362,7 +362,7 @@ zed_udev_monitor(void *arg) } int -zed_disk_event_init() +zed_disk_event_init(void) { int fd, fflags; @@ -398,7 +398,7 @@ zed_disk_event_init() } void -zed_disk_event_fini() +zed_disk_event_fini(void) { /* cancel monitor thread at recvmsg() */ (void) pthread_cancel(g_mon_tid); @@ -416,13 +416,13 @@ zed_disk_event_fini() #include "zed_disk_event.h" int -zed_disk_event_init() +zed_disk_event_init(void) { return (0); } void -zed_disk_event_fini() +zed_disk_event_fini(void) { } diff --git a/include/libzfs.h b/include/libzfs.h index c0e53b88a636..400102750ca2 100644 --- a/include/libzfs.h +++ b/include/libzfs.h @@ -39,10 +39,8 @@ #include #include #include -#include #include #include -#include #include #ifdef __cplusplus diff --git a/include/thread_pool.h b/include/thread_pool.h index 43090c3c6644..19edebd7da36 100644 --- a/include/thread_pool.h +++ b/include/thread_pool.h @@ -28,7 +28,6 @@ #define _THREAD_POOL_H_ extern __attribute__((visibility("default"))) #include -#include #include #ifdef __cplusplus diff --git a/lib/libspl/include/Makefile.am b/lib/libspl/include/Makefile.am index e995ddf66b92..96be936455f5 100644 --- a/lib/libspl/include/Makefile.am +++ b/lib/libspl/include/Makefile.am @@ -2,19 +2,12 @@ libspldir = $(includedir)/libspl libspl_HEADERS = \ %D%/assert.h \ %D%/atomic.h \ - %D%/libdevinfo.h \ %D%/libgen.h \ %D%/libshare.h \ - %D%/limits.h \ - %D%/locale.h \ %D%/statcommon.h \ %D%/stdio.h \ %D%/stdlib.h \ %D%/string.h \ - %D%/stropts.h \ - %D%/thread.h \ - %D%/tzfile.h \ - %D%/ucred.h \ %D%/umem.h \ %D%/unistd.h \ %D%/zone.h @@ -41,8 +34,6 @@ libspl_sys_HEADERS = \ %D%/sys/dkio.h \ %D%/sys/dklabel.h \ %D%/sys/feature_tests.h \ - %D%/sys/int_limits.h \ - %D%/sys/int_types.h \ %D%/sys/inttypes.h \ %D%/sys/isa_defs.h \ %D%/sys/kmem.h \ @@ -60,7 +51,6 @@ libspl_sys_HEADERS = \ %D%/sys/stack.h \ %D%/sys/stdtypes.h \ %D%/sys/string.h \ - %D%/sys/stropts.h \ %D%/sys/sunddi.h \ %D%/sys/systeminfo.h \ %D%/sys/time.h \ @@ -68,10 +58,7 @@ libspl_sys_HEADERS = \ %D%/sys/trace_zfs.h \ %D%/sys/types.h \ %D%/sys/types32.h \ - %D%/sys/tzfile.h \ %D%/sys/uio.h \ - %D%/sys/va_list.h \ - %D%/sys/varargs.h \ %D%/sys/vnode.h \ %D%/sys/wmsum.h \ %D%/sys/zone.h diff --git a/lib/libspl/include/libdevinfo.h b/lib/libspl/include/libdevinfo.h deleted file mode 100644 index be1d291f4051..000000000000 --- a/lib/libspl/include/libdevinfo.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _LIBSPL_LIBDEVINFO_H -#define _LIBSPL_LIBDEVINFO_H - -#endif /* _LIBSPL_LIBDEVINFO_H */ diff --git a/lib/libspl/include/limits.h b/lib/libspl/include/limits.h deleted file mode 100644 index 5d996eb846d1..000000000000 --- a/lib/libspl/include/limits.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#include_next -#include - -#ifndef _LIBSPL_LIMITS_H -#define _LIBSPL_LIMITS_H - -#ifndef DBL_DIG -#define DBL_DIG 15 -#define DBL_MAX 1.7976931348623157081452E+308 -#define DBL_MIN 2.2250738585072013830903E-308 -#endif - -#ifndef FLT_DIG -#define FLT_DIG 6 -#define FLT_MAX 3.4028234663852885981170E+38F -#define FLT_MIN 1.1754943508222875079688E-38F -#endif - -#endif /* _LIBSPL_LIMITS_H */ diff --git a/lib/libspl/include/locale.h b/lib/libspl/include/locale.h deleted file mode 100644 index 6c74df72072e..000000000000 --- a/lib/libspl/include/locale.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 2008 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#include_next - -#ifndef _LIBSPL_LOCALE_H -#define _LIBSPL_LOCALE_H - -#include -#include - -#endif diff --git a/lib/libspl/include/os/freebsd/sys/byteorder.h b/lib/libspl/include/os/freebsd/sys/byteorder.h index cd692d3616e0..d4227ddc5465 100644 --- a/lib/libspl/include/os/freebsd/sys/byteorder.h +++ b/lib/libspl/include/os/freebsd/sys/byteorder.h @@ -43,7 +43,7 @@ #include #include #include -#include +#include #if defined(__GNUC__) && defined(_ASM_INLINES) && \ (defined(__i386) || defined(__amd64)) diff --git a/lib/libspl/include/os/freebsd/sys/mnttab.h b/lib/libspl/include/os/freebsd/sys/mnttab.h index c08349bdf9bd..54c1bc59ab56 100644 --- a/lib/libspl/include/os/freebsd/sys/mnttab.h +++ b/lib/libspl/include/os/freebsd/sys/mnttab.h @@ -79,7 +79,7 @@ extern int _sol_getmntent(FILE *fp, struct mnttab *mp); extern int getextmntent(const char *path, struct extmnttab *entry, struct stat64 *statbuf); extern void statfs2mnttab(struct statfs *sfs, struct mnttab *mp); -char *hasmntopt(struct mnttab *mnt, char *opt); -int getmntent(FILE *fp, struct mnttab *mp); +extern char *hasmntopt(struct mnttab *mnt, char *opt); +extern int getmntent(FILE *fp, struct mnttab *mp); #endif diff --git a/lib/libspl/include/os/freebsd/sys/zfs_context_os.h b/lib/libspl/include/os/freebsd/sys/zfs_context_os.h index b9bf487c2aef..9b9d69bddcf7 100644 --- a/lib/libspl/include/os/freebsd/sys/zfs_context_os.h +++ b/lib/libspl/include/os/freebsd/sys/zfs_context_os.h @@ -30,6 +30,5 @@ #define ZFS_CONTEXT_OS_H_ #define HAVE_LARGE_STACKS 1 -#define ZFS_EXPORTS_PATH "/etc/zfs/exports" #endif diff --git a/lib/libspl/include/os/linux/sys/byteorder.h b/lib/libspl/include/os/linux/sys/byteorder.h index d5ee3e26f5a5..47af7700f031 100644 --- a/lib/libspl/include/os/linux/sys/byteorder.h +++ b/lib/libspl/include/os/linux/sys/byteorder.h @@ -46,7 +46,7 @@ #endif #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/lib/libspl/include/stropts.h b/lib/libspl/include/stropts.h deleted file mode 100644 index 37acd4052b0b..000000000000 --- a/lib/libspl/include/stropts.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 - */ - -#ifndef _LIBSPL_STROPTS_H -#define _LIBSPL_STROPTS_H - -#endif /* _LIBSPL_STROPTS_H */ diff --git a/lib/libspl/include/sys/int_limits.h b/lib/libspl/include/sys/int_limits.h deleted file mode 100644 index 7af68cdb2998..000000000000 --- a/lib/libspl/include/sys/int_limits.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _LIBSPL_SYS_INT_LIMITS_H -#define _LIBSPL_SYS_INT_LIMITS_H - -#endif diff --git a/lib/libspl/include/sys/int_types.h b/lib/libspl/include/sys/int_types.h deleted file mode 100644 index 51e9e0285490..000000000000 --- a/lib/libspl/include/sys/int_types.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _SOL_SYS_INT_TYPES_H -#define _SOL_SYS_INT_TYPES_H - -#include - -#endif diff --git a/lib/libspl/include/sys/kstat.h b/lib/libspl/include/sys/kstat.h index 7f9aa6d8dbd7..c2de0778485c 100644 --- a/lib/libspl/include/sys/kstat.h +++ b/lib/libspl/include/sys/kstat.h @@ -92,39 +92,6 @@ typedef struct kstat { void *ks_lock; /* protects this kstat's data */ } kstat_t; -#ifdef _SYSCALL32 - -typedef int32_t kid32_t; - -typedef struct kstat32 { - /* - * Fields relevant to both kernel and user - */ - hrtime_t ks_crtime; - caddr32_t ks_next; /* struct kstat pointer */ - kid32_t ks_kid; - char ks_module[KSTAT_STRLEN]; - uint8_t ks_resv; - int32_t ks_instance; - char ks_name[KSTAT_STRLEN]; - uint8_t ks_type; - char ks_class[KSTAT_STRLEN]; - uint8_t ks_flags; - caddr32_t ks_data; /* type-specific data */ - uint32_t ks_ndata; - size32_t ks_data_size; - hrtime_t ks_snaptime; - /* - * Fields relevant to kernel only (only needed here for padding) - */ - int32_t _ks_update; - caddr32_t _ks_private; - int32_t _ks_snapshot; - caddr32_t _ks_lock; -} kstat32_t; - -#endif /* _SYSCALL32 */ - /* * kstat structure and locking strategy * @@ -467,7 +434,7 @@ typedef struct kstat_named { * 64-bit compilation environments or 32-bit non-maximally conformant * C89 or C90 ANSI C compilation environments (cc -Xt and cc -Xa). In the * C99 ANSI C compilation environment, the long long type is supported. - * The _INT64_TYPE is defined by the implementation (see sys/int_types.h). + * The _INT64_TYPE is defined by the implementation (see sys/inttypes.h). */ #if defined(_INT64_TYPE) int64_t i64; diff --git a/lib/libspl/include/sys/stropts.h b/lib/libspl/include/sys/stropts.h deleted file mode 100644 index 08c2e79bc53c..000000000000 --- a/lib/libspl/include/sys/stropts.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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 2010 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _LIBSPL_SYS_STROPTS_H -#define _LIBSPL_SYS_STROPTS_H - -#endif /* _LIBSPL_SYS_STROPTS_H */ diff --git a/lib/libspl/include/sys/types.h b/lib/libspl/include/sys/types.h index ea02ffac93ac..f32c2188a111 100644 --- a/lib/libspl/include/sys/types.h +++ b/lib/libspl/include/sys/types.h @@ -37,7 +37,7 @@ #include #include_next #include -#include +#include #include #ifndef HAVE_INTTYPES diff --git a/lib/libspl/include/sys/tzfile.h b/lib/libspl/include/sys/tzfile.h deleted file mode 100644 index e30e7566366e..000000000000 --- a/lib/libspl/include/sys/tzfile.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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 2007 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -/* - * from Arthur Olson's 6.1 - */ - -#ifndef _LIBSPL_SYS_TZFILE_H -#define _LIBSPL_SYS_TZFILE_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* - * Information about time zone files. - */ - -#define TZDIR "/usr/share/lib/zoneinfo" /* Time zone object file directory */ - -#define TZDEFAULT (getenv("TZ")) - -#define TZDEFRULES "posixrules" - -/* - * Each file begins with. . . - */ - -struct tzhead { - char tzh_reserved[24]; /* reserved for future use */ - char tzh_ttisstdcnt[4]; /* coded number of trans. time flags */ - char tzh_leapcnt[4]; /* coded number of leap seconds */ - char tzh_timecnt[4]; /* coded number of transition times */ - char tzh_typecnt[4]; /* coded number of local time types */ - char tzh_charcnt[4]; /* coded number of abbr. chars */ -}; - -/* - * . . .followed by. . . - * - * tzh_timecnt (char [4])s coded transition times a la time(2) - * tzh_timecnt (unsigned char)s types of local time starting at above - * tzh_typecnt repetitions of - * one (char [4]) coded GMT offset in seconds - * one (unsigned char) used to set tm_isdst - * one (unsigned char) that's an abbreviation list index - * tzh_charcnt (char)s '\0'-terminated zone abbreviations - * tzh_leapcnt repetitions of - * one (char [4]) coded leap second transition times - * one (char [4]) total correction after above - * tzh_ttisstdcnt (char)s indexed by type; if TRUE, transition - * time is standard time, if FALSE, - * transition time is wall clock time - * if absent, transition times are - * assumed to be wall clock time - */ - -/* - * In the current implementation, "tzset()" refuses to deal with files that - * exceed any of the limits below. - */ - -/* - * The TZ_MAX_TIMES value below is enough to handle a bit more than a - * year's worth of solar time (corrected daily to the nearest second) or - * 138 years of Pacific Presidential Election time - * (where there are three time zone transitions every fourth year). - */ -#define TZ_MAX_TIMES 370 - -#define TZ_MAX_TYPES 256 /* Limited by what (unsigned char)'s can hold */ - -#define TZ_MAX_CHARS 50 /* Maximum number of abbreviation characters */ - -#define TZ_MAX_LEAPS 50 /* Maximum number of leap second corrections */ - -#define SECSPERMIN 60 -#define MINSPERHOUR 60 -#define HOURSPERDAY 24 -#define DAYSPERWEEK 7 -#define DAYSPERNYEAR 365 -#define DAYSPERLYEAR 366 -#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR) -#define SECSPERDAY ((long)SECSPERHOUR * HOURSPERDAY) -#define MONSPERYEAR 12 - -#define TM_SUNDAY 0 -#define TM_MONDAY 1 -#define TM_TUESDAY 2 -#define TM_WEDNESDAY 3 -#define TM_THURSDAY 4 -#define TM_FRIDAY 5 -#define TM_SATURDAY 6 - -#define TM_JANUARY 0 -#define TM_FEBRUARY 1 -#define TM_MARCH 2 -#define TM_APRIL 3 -#define TM_MAY 4 -#define TM_JUNE 5 -#define TM_JULY 6 -#define TM_AUGUST 7 -#define TM_SEPTEMBER 8 -#define TM_OCTOBER 9 -#define TM_NOVEMBER 10 -#define TM_DECEMBER 11 - -#define TM_YEAR_BASE 1900 - -#define EPOCH_YEAR 1970 -#define EPOCH_WDAY TM_THURSDAY - -/* - * Accurate only for the past couple of centuries; - * that will probably do. - */ - -#define isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0) - -/* - * Use of the underscored variants may cause problems if you move your code to - * certain System-V-based systems; for maximum portability, use the - * underscore-free variants. The underscored variants are provided for - * backward compatibility only; they may disappear from future versions of - * this file. - */ - -#define SECS_PER_MIN SECSPERMIN -#define MINS_PER_HOUR MINSPERHOUR -#define HOURS_PER_DAY HOURSPERDAY -#define DAYS_PER_WEEK DAYSPERWEEK -#define DAYS_PER_NYEAR DAYSPERNYEAR -#define DAYS_PER_LYEAR DAYSPERLYEAR -#define SECS_PER_HOUR SECSPERHOUR -#define SECS_PER_DAY SECSPERDAY -#define MONS_PER_YEAR MONSPERYEAR - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBSPL_SYS_TZFILE_H */ diff --git a/lib/libspl/include/sys/va_list.h b/lib/libspl/include/sys/va_list.h deleted file mode 100644 index a36f5c77daa9..000000000000 --- a/lib/libspl/include/sys/va_list.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _SYS_VA_LIST_H -#define _SYS_VA_LIST_H - -#include - -#endif diff --git a/lib/libspl/include/sys/varargs.h b/lib/libspl/include/sys/varargs.h deleted file mode 100644 index 3d00a3361d87..000000000000 --- a/lib/libspl/include/sys/varargs.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 2006 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _LIBSPL_SYS_VARARGS_H -#define _LIBSPL_SYS_VARARGS_H - -#endif diff --git a/lib/libspl/include/thread.h b/lib/libspl/include/thread.h deleted file mode 100644 index 74694e23eed5..000000000000 --- a/lib/libspl/include/thread.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 2009 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _LIBSPL_THREAD_H -#define _LIBSPL_THREAD_H - -#endif /* _LIBSPL_THREAD_H */ diff --git a/lib/libspl/include/tzfile.h b/lib/libspl/include/tzfile.h deleted file mode 100644 index 7bd4087cd5d1..000000000000 --- a/lib/libspl/include/tzfile.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 2007 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _LIBSPL_TZFILE_H -#define _LIBSPL_TZFILE_H - -#include - -#endif /* _LIBSPL_TZFILE_H */ diff --git a/lib/libspl/include/ucred.h b/lib/libspl/include/ucred.h deleted file mode 100644 index 8178fdec4c74..000000000000 --- a/lib/libspl/include/ucred.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 2007 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. - */ - -#ifndef _LIBSPL_UCRED_H -#define _LIBSPL_UCRED_H - -typedef int ucred_t; - -#endif diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 3469d380652e..674f749c2f3b 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -49,7 +49,6 @@ #include #include #include -#include #ifdef HAVE_IDMAP #include #include diff --git a/lib/libzfs/libzfs_diff.c b/lib/libzfs/libzfs_diff.c index e8b8a1dfc398..a414024bb427 100644 --- a/lib/libzfs/libzfs_diff.c +++ b/lib/libzfs/libzfs_diff.c @@ -41,7 +41,6 @@ #include #include #include -#include #include #include #include diff --git a/rpm/generic/zfs-kmod.spec.in b/rpm/generic/zfs-kmod.spec.in index 4ed719b8fe14..79fe2753c1e8 100644 --- a/rpm/generic/zfs-kmod.spec.in +++ b/rpm/generic/zfs-kmod.spec.in @@ -98,7 +98,7 @@ BuildRequires: %{_bindir}/kmodtool # Kmodtool does its magic here. A patched version of kmodtool is shipped # with the source rpm until kmod development packages are supported upstream. # https://bugzilla.rpmfusion.org/show_bug.cgi?id=2714 -%{expand:%(bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} --obsolete-name spl --obsolete-version 0.8 2>/dev/null) } +%{expand:%(bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null) } %description @@ -109,7 +109,7 @@ This package contains the ZFS kernel modules. %{?kmodtool_check} # Print kmodtool output for debugging purposes: -bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} --obsolete-name spl --obsolete-version 0.8 2>/dev/null +bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null %if %{with debug} %define debug --enable-debug diff --git a/rpm/redhat/zfs-kmod.spec.in b/rpm/redhat/zfs-kmod.spec.in index 7ee04e2340c6..f59551c0b43a 100644 --- a/rpm/redhat/zfs-kmod.spec.in +++ b/rpm/redhat/zfs-kmod.spec.in @@ -17,9 +17,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) # by generating a preamble text file which kmodtool can append to the spec file. %(/bin/echo -e "\ Requires: @PACKAGE@ = %{version}\n\ -Conflicts: @PACKAGE@-dkms\n\ -Obsoletes: kmod-spl\n\ -Obsoletes: spl-kmod\n\n" > %{_sourcedir}/kmod-preamble) +Conflicts: @PACKAGE@-dkms) # LDFLAGS are not sanitized by arch/*/Makefile for these architectures. %ifarch ppc ppc64 ppc64le aarch64 @@ -39,7 +37,6 @@ This package contains the ZFS kernel modules. %package -n kmod-%{kmod_name}-devel Summary: ZFS kernel module(s) devel common Group: System Environment/Kernel -Provides: kmod-spl-devel = %{version} %description -n kmod-%{kmod_name}-devel This package provides the header files and objects to build kernel modules. diff --git a/scripts/kmodtool b/scripts/kmodtool index f66341196acb..a79ad0c7a0f3 100755 --- a/scripts/kmodtool +++ b/scripts/kmodtool @@ -72,7 +72,7 @@ LANG=C rpmbuild --define "_sourcedir %{_sourcedir}" \\\ ln -s \$(ls \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/) \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/${kmodname}-kmod.latest %package -n akmod-${kmodname} -Summary: Akmod package for ${kmodname} kernel module(s) +Summary: Akmod package for ${kmodname} kernel module(s) Group: System Environment/Kernel Requires: kmodtool Requires: akmods @@ -82,11 +82,6 @@ Requires: ${kmodname}-kmod-common >= %{?epoch:%{epoch}:}%{version} Provides: ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release} EOF - if [ -n "${obsolete_name}" ]; then - echo "Provides: akmod-${obsolete_name} = ${obsolete_version}" - echo "Obsoletes: akmod-${obsolete_name} < ${obsolete_version}" - fi - cat <= %{?epoch:%{epoch}:}%{version}-%{release}" fi - if [ -n "${obsolete_name}" ]; then - echo "Provides: kmod-${obsolete_name}-devel = ${obsolete_version}" - echo "Obsoletes: kmod-${obsolete_name}-devel < ${obsolete_version}" - fi - cat <= %{?epoch:%{epoch}:}%{vers %{?KmodsMetaRequires:Requires: %{?KmodsMetaRequires}} EOF - if [ -n "${obsolete_name}" ]; then - echo "Provides: kmod-${obsolete_name}${kernel_variant} = ${obsolete_version}" - echo "Obsoletes: kmod-${obsolete_name}${kernel_variant} < ${obsolete_version}" - fi - cat <&2 - elif [ ! -e "${1}" ]; then + elif [ ! -e "${1}" ]; then error_out 2 "Filterfile ${1} not found" >&2 fi filterfile="${1}" @@ -505,22 +476,6 @@ while [ -n "${1}" ] ; do shift noakmod="true" ;; - --obsolete-name) - shift - if [ -z "${1}" ] ; then - error_out 2 "Please provide the name of the kmod to obsolete together with --obsolete-name" >&2 - fi - obsolete_name="${1}" - shift - ;; - --obsolete-version) - shift - if [ -z "${1}" ] ; then - error_out 2 "Please provide the version of the kmod to obsolete together with --obsolete-version" >&2 - fi - obsolete_version="${1}" - shift - ;; --target) shift target="${1}" @@ -574,8 +529,6 @@ elif [ -z "${kmodname}" ]; then error_out 2 "please pass kmodname with --kmodname" elif [ -z "${kernels_known_variants}" ] ; then error_out 2 "could not determine known variants" -elif { [ -n "${obsolete_name}" ] && [ -z "${obsolete_version}" ]; } || { [ -z "${obsolete_name}" ] && [ -n "${obsolete_version}" ]; } ; then - error_out 2 "you need to provide both --obsolete-name and --obsolete-version" fi # go @@ -599,21 +552,17 @@ else # call buildsys-build-${repo}-kerneldevpkgs to get the list of kernels cmdoptions="--target ${target}" - # filterfile to filter list of kernels? + # filterfile to filter list of kernels? if [ -n "${filterfile}" ] ; then cmdoptions="${cmdoptions} --filterfile ${filterfile}" fi - kernel_versions_to_build_for=$(buildsys-build-${repo}-kerneldevpkgs "--${build_kernels}" ${cmdoptions}) - returncode=$? - if [ "$returncode" -ne 0 ]; then - + kernel_versions_to_build_for=$(buildsys-build-${repo}-kerneldevpkgs "--${build_kernels}" ${cmdoptions}) || error_out 2 "buildsys-build-${repo}-kerneldevpkgs failed: ${kernel_versions_to_build_for}" - fi if [ "${build_kernels}" = "current" ] && [ -z "${noakmod}" ]; then print_akmodtemplate fi - print_rpmtemplate + print_rpmtemplate fi diff --git a/tests/zfs-tests/tests/Makefile.am b/tests/zfs-tests/tests/Makefile.am index 355ad727dfe2..74027e07c3f1 100644 --- a/tests/zfs-tests/tests/Makefile.am +++ b/tests/zfs-tests/tests/Makefile.am @@ -32,7 +32,7 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS = \ \ perf/scripts/prefetch_io.sh -# These lists can be regenerated by running, on a *clean* source: +# These lists can be regenerated by running make regen-tests at the root, or, on a *clean* source: # find functional/ ! -type d ! -name .gitignore ! -name .dirstamp ! -name '*.Po' ! -executable -name '*.in' | sort | sed 's/\.in$//;s/^/\t/;$!s/$/ \\/' # find functional/ ! -type d ! -name .gitignore ! -name .dirstamp ! -name '*.Po' -executable -name '*.in' | sort | sed 's/\.in$//;s/^/\t/;$!s/$/ \\/' # find functional/ ! -type d ! -name .gitignore ! -name .dirstamp ! -name '*.Po' ! -name '*.in' ! -name '*.c' | grep -Fe /simd -e /tmpfile | sort | sed 's/^/\t/;$!s/$/ \\/' @@ -43,6 +43,32 @@ nobase_dist_datadir_zfs_tests_tests_SCRIPTS = \ # # C programs are specced in ../Makefile.am above as part of the main Makefile +find_common := find functional/ ! -type d ! -name .gitignore ! -name .dirstamp ! -name '*.Po' +regen: + @$(MAKE) -C $(top_builddir) clean + @$(MAKE) clean + $(SED) $(ac_inplace) '/^# -- >8 --/q' Makefile.am + echo >> Makefile.am + echo 'nobase_nodist_datadir_zfs_tests_tests_DATA = \' >> Makefile.am + $(find_common) ! -executable -name '*.in' | sort | sed 's/\.in$$//;s/^/\t/;$$!s/$$/ \\/' >> Makefile.am + echo 'nobase_nodist_datadir_zfs_tests_tests_SCRIPTS = \' >> Makefile.am + $(find_common) -executable -name '*.in' | sort | sed 's/\.in$$//;s/^/\t/;$$!s/$$/ \\/' >> Makefile.am + echo >> Makefile.am + echo 'SUBSTFILES += $$(nobase_nodist_datadir_zfs_tests_tests_DATA) $$(nobase_nodist_datadir_zfs_tests_tests_SCRIPTS)' >> Makefile.am + echo >> Makefile.am + echo 'if BUILD_LINUX' >> Makefile.am + echo 'nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \' >> Makefile.am + $(find_common) ! -name '*.in' ! -name '*.c' | grep -Fe /simd -e /tmpfile | sort | sed 's/^/\t/;$$!s/$$/ \\/' >> Makefile.am + echo 'endif' >> Makefile.am + echo >> Makefile.am + echo 'nobase_dist_datadir_zfs_tests_tests_DATA += \' >> Makefile.am + $(find_common) ! -executable ! -name '*.in' ! -name '*.c' | grep -vFe /simd -e /tmpfile | sort | sed 's/^/\t/;$$!s/$$/ \\/' >> Makefile.am + echo >> Makefile.am + echo 'nobase_dist_datadir_zfs_tests_tests_SCRIPTS += \' >> Makefile.am + $(find_common) -executable ! -name '*.in' ! -name '*.c' | grep -vFe /simd -e /tmpfile | sort | sed 's/^/\t/;$$!s/$$/ \\/' >> Makefile.am + +# -- >8 -- + nobase_nodist_datadir_zfs_tests_tests_DATA = \ functional/pam/utilities.kshlib nobase_nodist_datadir_zfs_tests_tests_SCRIPTS = \