From owner-dev-commits-src-all@freebsd.org Sat Sep 18 21:33:00 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D7DBD67D380; Sat, 18 Sep 2021 21:33:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HBkZN5kn3z53wM; Sat, 18 Sep 2021 21:33:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9B03111797; Sat, 18 Sep 2021 21:33:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18ILX005070233; Sat, 18 Sep 2021 21:33:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18ILX0cF070230; Sat, 18 Sep 2021 21:33:00 GMT (envelope-from git) Date: Sat, 18 Sep 2021 21:33:00 GMT Message-Id: <202109182133.18ILX0cF070230@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Martin Matuska Subject: git: f941f0a06298 - stable/13 - zfs: merge openzfs/zfs@71c609852 (zfs-2.1-release) into stable/13 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mm X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f941f0a062982f77faaf326752c80ed69201cff4 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2021 21:33:00 -0000 The branch stable/13 has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=f941f0a062982f77faaf326752c80ed69201cff4 commit f941f0a062982f77faaf326752c80ed69201cff4 Merge: ec47ee78b461 71c6098526c6 Author: Martin Matuska AuthorDate: 2021-09-18 18:30:40 +0000 Commit: Martin Matuska CommitDate: 2021-09-18 18:44:14 +0000 zfs: merge openzfs/zfs@71c609852 (zfs-2.1-release) into stable/13 OpenZFS release 2.1.1 Notable upstream pull request merges: #11997 FreeBSD: Don't force xattr mount option #11997 FreeBSD: Implement xattr=sa #11997 FreeBSD: Use SET_ERROR to trace xattr name errors #12022 Fix endianness issues with zstd #12161 Restore FreeBSD sysctl processing for arc.min and arc.max #12183 Optimize small random numbers generation #12246 arc: Drop an incorrect assert #12271 Tinker with slop space accounting with dedup #12279 Fix ARC ghost states eviction accounting #12281 Move gethrtime() calls out of vdev queue lock #12289 Compact dbuf/buf hashes and lock arrays #12294 Upstream: dmu_zfetch_stream_fini leaks refcount #12295 Fix abd leak, kmem_free correct size of abd_t #12297 Avoid vq_lock drop in vdev_queue_aggregate() #12299 file reference counts can get corrupted #12300 Introduce dsl_dir_diduse_transfer_space() #12314 Optimize allocation throttling #12320 FreeBSD: Use unmapped I/O for scattered/gang ABD buffers #12328 FreeBSD: Hardcode abd_chunk_size to PAGE_SIZE #12339 Read past end of argv array in zpool_do_import() #12348 Minor ARC optimizations #12365 Fixes in persistent L2ARC #12375 FreeBSD: Ignore make_dev_s() errors #12378 FreeBSD: Switch from MAXPHYS to maxphys on FreeBSD 13+ #12383 Fixes for KMSAN reports #12397 Run arc_evict thread at higher priority #12398 Remove b_pabd/b_rabd allocation from arc_hdr_alloc() #12422 Fix/improve dbuf hits accounting #12428 Fix unfortunate NULL in spa_update_dspace #12443 Fixed data integrity issue when underlying disk returns error #12446 Allow disabling of unmapped I/O on FreeBSD #12473 Initialize parity blocks before RAID-Z reconstruction benchmarking #12511 Make 'zpool labelclear -f' work on offlined disks #12514 FreeBSD: Don't remove SA xattr if not SA znode #12522 Compressed receive with different ashift can result in incorrect PSIZE on disk #12535 Verify embedded blkptr's in arc_read() #12541 Allow sending corrupt snapshots even if metadata is corrupted Manually included upstream 2.1 backport pull request #12573: #12282 FreeBSD: fix compilation of FreeBSD world after 29274c9 Obtained from: OpenZFS OpenZFS commit: 71c6098526c6d5fbfa84a58cefe6cdc403488d8c OpenZFS tag: zfs-2.1.1 Relnotes: yes .../openzfs/.github/ISSUE_TEMPLATE/bug_report.md | 16 +- .../openzfs/.github/workflows/checkstyle.yaml | 18 +- sys/contrib/openzfs/.github/workflows/zloop.yml | 2 +- sys/contrib/openzfs/META | 4 +- sys/contrib/openzfs/Makefile.am | 14 +- sys/contrib/openzfs/cmd/vdev_id/vdev_id | 5 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 6 +- sys/contrib/openzfs/cmd/zed/agents/zfs_mod.c | 40 +- sys/contrib/openzfs/cmd/zed/zed_disk_event.c | 2 + sys/contrib/openzfs/cmd/zfs/zfs_main.c | 2 +- sys/contrib/openzfs/cmd/zpool/zpool.d/media | 9 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 50 +- .../openzfs/cmd/zpool_influxdb/zpool_influxdb.c | 3 +- sys/contrib/openzfs/cmd/zvol_id/zvol_id_main.c | 58 +- sys/contrib/openzfs/config/Abigail.am | 6 +- sys/contrib/openzfs/config/kernel-acl.m4 | 23 +- sys/contrib/openzfs/config/kernel-blk-queue.m4 | 40 + sys/contrib/openzfs/config/kernel-blkdev.m4 | 2 +- .../openzfs/config/kernel-make-request-fn.m4 | 20 + sys/contrib/openzfs/config/kernel-stdarg.m4 | 32 + .../openzfs/config/kernel-vfs-set_page_dirty.m4 | 34 + sys/contrib/openzfs/config/kernel.m4 | 4 + sys/contrib/openzfs/config/user-libatomic.m4 | 34 +- sys/contrib/openzfs/configure.ac | 1 + .../openzfs/include/os/freebsd/spl/sys/mod_os.h | 6 + .../openzfs/include/os/freebsd/spl/sys/random.h | 22 + .../include/os/linux/kernel/linux/blkdev_compat.h | 3 + .../openzfs/include/os/linux/spl/sys/cmn_err.h | 4 + .../openzfs/include/os/linux/spl/sys/random.h | 15 + .../openzfs/include/os/linux/zfs/sys/trace_arc.h | 4 +- .../include/os/linux/zfs/sys/zfs_znode_impl.h | 4 +- sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h | 4 + sys/contrib/openzfs/include/sys/abd.h | 1 - sys/contrib/openzfs/include/sys/abd_impl.h | 2 +- sys/contrib/openzfs/include/sys/arc.h | 9 +- sys/contrib/openzfs/include/sys/arc_impl.h | 26 +- sys/contrib/openzfs/include/sys/dbuf.h | 6 +- sys/contrib/openzfs/include/sys/dnode.h | 2 +- sys/contrib/openzfs/include/sys/dsl_dir.h | 3 + sys/contrib/openzfs/include/sys/fm/util.h | 5 +- sys/contrib/openzfs/include/sys/metaslab_impl.h | 2 +- sys/contrib/openzfs/include/sys/spa.h | 1 - sys/contrib/openzfs/include/sys/spa_impl.h | 15 +- sys/contrib/openzfs/include/sys/zfs_context.h | 15 + sys/contrib/openzfs/include/sys/zfs_file.h | 6 +- sys/contrib/openzfs/include/sys/zfs_ioctl.h | 2 +- sys/contrib/openzfs/include/sys/zfs_onexit.h | 4 +- sys/contrib/openzfs/include/sys/zfs_refcount.h | 8 +- sys/contrib/openzfs/include/sys/zio.h | 4 +- sys/contrib/openzfs/include/sys/zstd/zstd.h | 148 +- sys/contrib/openzfs/include/sys/zthr.h | 5 +- sys/contrib/openzfs/lib/libnvpair/libnvpair.abi | 4832 ++++---- sys/contrib/openzfs/lib/libuutil/libuutil.abi | 3351 +++-- sys/contrib/openzfs/lib/libzfs/libzfs.abi | 12225 +++++++++++-------- sys/contrib/openzfs/lib/libzfs/libzfs_crypto.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 3 +- .../openzfs/lib/libzfs_core/libzfs_core.abi | 6159 +++++++--- .../openzfs/lib/libzfsbootenv/libzfsbootenv.abi | 596 +- sys/contrib/openzfs/lib/libzpool/kernel.c | 20 +- sys/contrib/openzfs/man/man4/zfs.4 | 26 +- sys/contrib/openzfs/man/man8/zfs-allow.8 | 28 +- sys/contrib/openzfs/man/man8/zfs-send.8 | 10 +- sys/contrib/openzfs/man/man8/zpool-remove.8 | 8 +- sys/contrib/openzfs/man/man8/zpool-scrub.8 | 29 +- sys/contrib/openzfs/module/nvpair/nvpair.c | 64 +- .../openzfs/module/os/freebsd/spl/acl_common.c | 6 +- sys/contrib/openzfs/module/os/freebsd/spl/callb.c | 16 +- sys/contrib/openzfs/module/os/freebsd/spl/list.c | 17 +- .../openzfs/module/os/freebsd/spl/spl_kmem.c | 6 +- .../openzfs/module/os/freebsd/spl/spl_kstat.c | 10 +- .../openzfs/module/os/freebsd/spl/spl_string.c | 2 +- .../openzfs/module/os/freebsd/spl/spl_sysevent.c | 2 +- .../openzfs/module/os/freebsd/spl/spl_uio.c | 4 +- .../openzfs/module/os/freebsd/spl/spl_vfs.c | 6 +- sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 137 +- sys/contrib/openzfs/module/os/freebsd/zfs/arc_os.c | 4 +- sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c | 45 +- sys/contrib/openzfs/module/os/freebsd/zfs/spa_os.c | 83 +- .../openzfs/module/os/freebsd/zfs/sysctl_os.c | 53 +- .../openzfs/module/os/freebsd/zfs/vdev_file.c | 7 +- .../openzfs/module/os/freebsd/zfs/vdev_geom.c | 151 +- .../openzfs/module/os/freebsd/zfs/vdev_label_os.c | 2 +- .../openzfs/module/os/freebsd/zfs/zfs_acl.c | 37 +- .../openzfs/module/os/freebsd/zfs/zfs_ctldir.c | 22 +- .../openzfs/module/os/freebsd/zfs/zfs_dir.c | 23 +- .../openzfs/module/os/freebsd/zfs/zfs_file_os.c | 19 +- .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c | 34 +- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 558 +- .../openzfs/module/os/freebsd/zfs/zfs_znode.c | 98 +- .../openzfs/module/os/freebsd/zfs/zio_crypt.c | 2 +- .../openzfs/module/os/freebsd/zfs/zvol_os.c | 37 +- sys/contrib/openzfs/module/os/linux/zfs/abd_os.c | 3 +- sys/contrib/openzfs/module/os/linux/zfs/arc_os.c | 18 +- .../openzfs/module/os/linux/zfs/qat_compress.c | 27 +- .../openzfs/module/os/linux/zfs/zfs_file_os.c | 28 +- .../openzfs/module/os/linux/zfs/zfs_vnops_os.c | 8 +- .../openzfs/module/os/linux/zfs/zfs_znode.c | 12 +- sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 25 +- .../openzfs/module/os/linux/zfs/zpl_inode.c | 34 +- .../openzfs/module/os/linux/zfs/zpl_xattr.c | 34 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 44 +- sys/contrib/openzfs/module/zfs/abd.c | 2 +- sys/contrib/openzfs/module/zfs/arc.c | 603 +- sys/contrib/openzfs/module/zfs/dbuf.c | 6 +- sys/contrib/openzfs/module/zfs/ddt.c | 2 +- sys/contrib/openzfs/module/zfs/dmu_redact.c | 2 + sys/contrib/openzfs/module/zfs/dmu_send.c | 2 + sys/contrib/openzfs/module/zfs/dmu_zfetch.c | 2 + sys/contrib/openzfs/module/zfs/dnode.c | 1 + sys/contrib/openzfs/module/zfs/dsl_dataset.c | 10 +- sys/contrib/openzfs/module/zfs/dsl_dir.c | 112 +- sys/contrib/openzfs/module/zfs/fm.c | 20 +- sys/contrib/openzfs/module/zfs/metaslab.c | 29 +- sys/contrib/openzfs/module/zfs/mmp.c | 4 +- sys/contrib/openzfs/module/zfs/multilist.c | 5 +- sys/contrib/openzfs/module/zfs/refcount.c | 51 +- sys/contrib/openzfs/module/zfs/spa.c | 27 +- sys/contrib/openzfs/module/zfs/spa_misc.c | 78 +- sys/contrib/openzfs/module/zfs/space_map.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_indirect.c | 6 +- sys/contrib/openzfs/module/zfs/vdev_mirror.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_queue.c | 74 +- sys/contrib/openzfs/module/zfs/vdev_raidz_math.c | 7 + sys/contrib/openzfs/module/zfs/zcp_synctask.c | 15 +- sys/contrib/openzfs/module/zfs/zfs_ioctl.c | 71 +- sys/contrib/openzfs/module/zfs/zfs_log.c | 4 +- sys/contrib/openzfs/module/zfs/zfs_onexit.c | 23 +- sys/contrib/openzfs/module/zfs/zil.c | 60 +- sys/contrib/openzfs/module/zfs/zio.c | 65 +- sys/contrib/openzfs/module/zfs/zio_compress.c | 2 +- sys/contrib/openzfs/module/zfs/zio_inject.c | 8 +- sys/contrib/openzfs/module/zfs/zthr.c | 19 +- sys/contrib/openzfs/module/zfs/zvol.c | 15 +- sys/contrib/openzfs/module/zstd/Makefile.in | 1 + .../openzfs/module/zstd/include/sparc_compat.h | 4 + sys/contrib/openzfs/module/zstd/zfs_zstd.c | 14 +- sys/contrib/openzfs/module/zstd/zstd_sparc.c | 11 + sys/contrib/openzfs/scripts/zfs-tests.sh | 27 +- sys/contrib/openzfs/scripts/zfs.sh | 12 +- sys/contrib/openzfs/scripts/zloop.sh | 60 +- sys/contrib/openzfs/tests/Makefile.am | 2 +- sys/contrib/openzfs/tests/runfiles/common.run | 7 +- sys/contrib/openzfs/tests/runfiles/linux.run | 9 +- .../openzfs/tests/test-runner/bin/zts-report.py.in | 17 +- .../openzfs/tests/zfs-tests/include/blkdev.shlib | 2 +- .../openzfs/tests/zfs-tests/include/libtest.shlib | 28 + .../openzfs/tests/zfs-tests/include/tunables.cfg | 2 +- .../tests/zfs-tests/tests/functional/Makefile.am | 1 + .../cli_root/zfs_copies/zfs_copies.kshlib | 7 +- .../cli_root/zfs_diff/zfs_diff_timestamp.ksh | 6 +- .../cli_root/zfs_rename/zfs_rename_006_pos.ksh | 2 +- .../cli_root/zfs_rename/zfs_rename_007_pos.ksh | 8 +- .../cli_root/zpool_import/zpool_import_errata3.ksh | 4 +- .../zfs-tests/tests/functional/crtime/Makefile.am | 5 + .../zfs-tests/tests/functional/crtime/cleanup.ksh | 34 + .../tests/functional/crtime/crtime_001_pos.ksh | 71 + .../zfs-tests/tests/functional/crtime/setup.ksh | 35 + .../zfs-tests/tests/functional/fault/Makefile.am | 1 + .../tests/functional/fault/auto_online_002_pos.ksh | 94 + .../zfs-tests/tests/functional/l2arc/Makefile.am | 5 +- .../tests/functional/l2arc/l2arc_arcstats_pos.ksh | 1 - .../functional/l2arc/persist_l2arc_004_pos.ksh | 55 +- .../functional/l2arc/persist_l2arc_005_pos.ksh | 69 +- .../functional/l2arc/persist_l2arc_006_pos.ksh | 101 - .../functional/l2arc/persist_l2arc_007_pos.ksh | 97 - .../functional/l2arc/persist_l2arc_008_pos.ksh | 143 - .../functional/redacted_send/redacted_panic.ksh | 10 +- .../functional/rsend/recv_dedup_encrypted_zvol.ksh | 2 +- .../rsend/send-c_stream_size_estimate.ksh | 2 +- .../zvol/zvol_misc/zvol_misc_volmode.ksh | 2 + .../zvol/zvol_swap/zvol_swap_004_pos.ksh | 2 +- .../openzfs/tests/zfs-tests/tests/perf/perf.shlib | 61 +- .../tests/perf/regression/random_reads.ksh | 30 +- .../tests/perf/regression/random_readwrite.ksh | 30 +- .../perf/regression/random_readwrite_fixed.ksh | 30 +- .../tests/perf/regression/random_writes.ksh | 30 +- .../tests/perf/regression/random_writes_zil.ksh | 31 +- .../tests/perf/regression/sequential_reads.ksh | 30 +- .../regression/sequential_reads_arc_cached.ksh | 30 +- .../sequential_reads_arc_cached_clone.ksh | 31 +- .../regression/sequential_reads_dbuf_cached.ksh | 32 +- .../tests/perf/regression/sequential_writes.ksh | 30 +- .../zfs-tests/tests/perf/regression/setup.ksh | 3 +- sys/contrib/openzfs/udev/rules.d/60-zvol.rules.in | 2 +- sys/modules/zfs/Makefile | 3 +- sys/modules/zfs/zfs_config.h | 50 +- sys/modules/zfs/zfs_gitrev.h | 2 +- 188 files changed, 19722 insertions(+), 12707 deletions(-) diff --cc sys/contrib/openzfs/config/kernel-stdarg.m4 index 000000000000,5bc8dd859d6b..5bc8dd859d6b mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-stdarg.m4 +++ b/sys/contrib/openzfs/config/kernel-stdarg.m4 diff --cc sys/contrib/openzfs/config/kernel-vfs-set_page_dirty.m4 index 000000000000,a9d252e4e01e..a9d252e4e01e mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-vfs-set_page_dirty.m4 +++ b/sys/contrib/openzfs/config/kernel-vfs-set_page_dirty.m4 diff --cc sys/contrib/openzfs/include/os/freebsd/spl/sys/random.h index b3c9115f5305,000000000000..7583166e727b mode 100644,000000..100644 --- a/sys/contrib/openzfs/include/os/freebsd/spl/sys/random.h +++ b/sys/contrib/openzfs/include/os/freebsd/spl/sys/random.h @@@ -1,48 -1,0 +1,70 @@@ +/* + * Copyright (c) 2007 Pawel Jakub Dawidek + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _OPENSOLARIS_SYS_RANDOM_H_ +#define _OPENSOLARIS_SYS_RANDOM_H_ + +#include_next ++#if __FreeBSD_version >= 1300108 ++#include ++#endif + +static inline int +random_get_bytes(uint8_t *p, size_t s) +{ + arc4rand(p, (int)s, 0); + return (0); +} + +static inline int +random_get_pseudo_bytes(uint8_t *p, size_t s) +{ + arc4rand(p, (int)s, 0); + return (0); +} + ++static inline uint32_t ++random_in_range(uint32_t range) ++{ ++#if defined(_KERNEL) && __FreeBSD_version >= 1300108 ++ return (prng32_bounded(range)); ++#else ++ uint32_t r; ++ ++ ASSERT(range != 0); ++ ++ if (range == 1) ++ return (0); ++ ++ (void) random_get_pseudo_bytes((uint8_t *)&r, sizeof (r)); ++ ++ return (r % range); ++#endif ++} ++ +#endif /* !_OPENSOLARIS_SYS_RANDOM_H_ */ diff --cc sys/contrib/openzfs/include/os/linux/spl/sys/random.h index 1b8cb60d094f,000000000000..52e97e1ce068 mode 100644,000000..100644 --- a/sys/contrib/openzfs/include/os/linux/spl/sys/random.h +++ b/sys/contrib/openzfs/include/os/linux/spl/sys/random.h @@@ -1,39 -1,0 +1,54 @@@ +/* + * Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC. + * Copyright (C) 2007 The Regents of the University of California. + * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). + * Written by Brian Behlendorf . + * UCRL-CODE-235197 + * + * This file is part of the SPL, Solaris Porting Layer. + * + * The SPL is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * The SPL is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with the SPL. If not, see . + */ + +#ifndef _SPL_RANDOM_H +#define _SPL_RANDOM_H + +#include +#include + +static __inline__ int +random_get_bytes(uint8_t *ptr, size_t len) +{ + get_random_bytes((void *)ptr, (int)len); + return (0); +} + +extern int random_get_pseudo_bytes(uint8_t *ptr, size_t len); + ++static __inline__ uint32_t ++random_in_range(uint32_t range) ++{ ++ uint32_t r; ++ ++ ASSERT(range != 0); ++ ++ if (range == 1) ++ return (0); ++ ++ (void) random_get_pseudo_bytes((uint8_t *)&r, sizeof (r)); ++ ++ return (r % range); ++} ++ +#endif /* _SPL_RANDOM_H */ diff --cc sys/contrib/openzfs/include/sys/zfs_context.h index ffb20e1fefad,dbeb323ba428..e430d17a5f9b --- a/sys/contrib/openzfs/include/sys/zfs_context.h +++ b/sys/contrib/openzfs/include/sys/zfs_context.h @@@ -640,6 -640,21 +640,21 @@@ extern int lowbit64(uint64_t i) extern int random_get_bytes(uint8_t *ptr, size_t len); extern int random_get_pseudo_bytes(uint8_t *ptr, size_t len); + static __inline__ uint32_t + random_in_range(uint32_t range) + { + uint32_t r; + + ASSERT(range != 0); + + if (range == 1) + return (0); + - (void) random_get_pseudo_bytes((void *)&r, sizeof (r)); ++ (void) random_get_pseudo_bytes((uint8_t *)&r, sizeof (r)); + + return (r % range); + } + extern void kernel_init(int mode); extern void kernel_fini(void); extern void random_init(void); diff --cc sys/contrib/openzfs/module/zstd/include/sparc_compat.h index 000000000000,14c1bdde917c..14c1bdde917c mode 000000,100644..100644 --- a/sys/contrib/openzfs/module/zstd/include/sparc_compat.h +++ b/sys/contrib/openzfs/module/zstd/include/sparc_compat.h diff --cc sys/contrib/openzfs/module/zstd/zstd_sparc.c index 000000000000,463df99bd7e3..463df99bd7e3 mode 000000,100644..100644 --- a/sys/contrib/openzfs/module/zstd/zstd_sparc.c +++ b/sys/contrib/openzfs/module/zstd/zstd_sparc.c diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/Makefile.am index 000000000000,13e1c2dde31b..13e1c2dde31b mode 000000,100644..100644 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/Makefile.am +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/Makefile.am diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/cleanup.ksh index 000000000000,3166bd6ec16e..3166bd6ec16e mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/cleanup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/cleanup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh index 000000000000,4f9810553fa6..4f9810553fa6 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/crtime_001_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/setup.ksh index 000000000000,fc5cec3063a6..fc5cec3063a6 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/setup.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/crtime/setup.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/fault/auto_online_002_pos.ksh index 000000000000,60185ace34bb..60185ace34bb mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/fault/auto_online_002_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/fault/auto_online_002_pos.ksh diff --cc sys/modules/zfs/Makefile index 983f0aa0e994,000000000000..d185fdf259a5 mode 100644,000000..100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@@ -1,340 -1,0 +1,341 @@@ +# $FreeBSD$ + +SRCDIR=${SRCTOP}/sys/contrib/openzfs/module +INCDIR=${SRCTOP}/sys/contrib/openzfs/include + +KMOD= zfs + +.PATH: ${SRCDIR}/avl \ + ${SRCDIR}/lua \ + ${SRCDIR}/nvpair \ + ${SRCDIR}/os/freebsd/spl \ + ${SRCDIR}/os/freebsd/zfs \ + ${SRCDIR}/unicode \ + ${SRCDIR}/zcommon \ + ${SRCDIR}/zfs \ + ${SRCDIR}/zstd \ + ${SRCDIR}/zstd/lib + + +CFLAGS+= -I${INCDIR} +CFLAGS+= -I${INCDIR}/os/freebsd +CFLAGS+= -I${INCDIR}/os/freebsd/spl +CFLAGS+= -I${INCDIR}/os/freebsd/zfs +CFLAGS+= -I${SRCDIR}/zstd/include +CFLAGS+= -I${.CURDIR} + +CFLAGS+= -D__KERNEL__ -DFREEBSD_NAMECACHE -DBUILDING_ZFS \ + -DHAVE_UIO_ZEROCOPY -DWITHOUT_NETDUMP -D__KERNEL -D_SYS_CONDVAR_H_ \ + -D_SYS_VMEM_H_ -DIN_FREEBSD_BASE -DHAVE_KSID + +.if ${MACHINE_ARCH} == "amd64" +CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F -DHAVE_AVX512BW -DHAVE_SSSE3 +.endif + +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm" +CFLAGS+= -DBITS_PER_LONG=32 +.else +CFLAGS+= -DBITS_PER_LONG=64 +.endif + +SRCS= vnode_if.h device_if.h bus_if.h + +# avl +SRCS+= avl.c + +#lua +SRCS+= lapi.c \ + lauxlib.c \ + lbaselib.c \ + lcode.c \ + lcompat.c \ + lcorolib.c \ + lctype.c \ + ldebug.c \ + ldo.c \ + lfunc.c \ + lgc.c \ + llex.c \ + lmem.c \ + lobject.c \ + lopcodes.c \ + lparser.c \ + lstate.c \ + lstring.c \ + lstrlib.c \ + ltable.c \ + ltablib.c \ + ltm.c \ + lvm.c \ + lzio.c + +#nvpair +SRCS+= nvpair.c \ + fnvpair.c \ + nvpair_alloc_spl.c \ + nvpair_alloc_fixed.c + +#os/freebsd/spl +SRCS+= acl_common.c \ + btree.c \ + callb.c \ + list.c \ + spl_acl.c \ + spl_cmn_err.c \ + spl_dtrace.c \ + spl_kmem.c \ + spl_kstat.c \ + spl_misc.c \ + spl_policy.c \ + spl_string.c \ + spl_sunddi.c \ + spl_sysevent.c \ + spl_taskq.c \ + spl_uio.c \ + spl_vfs.c \ + spl_vm.c \ + spl_zone.c \ + sha256c.c \ + sha512c.c \ + spl_procfs_list.c \ + spl_zlib.c + + +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm" +SRCS+= spl_atomic.c +.endif + +#os/freebsd/zfs +SRCS+= abd_os.c \ + crypto_os.c \ + dmu_os.c \ + hkdf.c \ + kmod_core.c \ + spa_os.c \ + sysctl_os.c \ + vdev_file.c \ + vdev_label_os.c \ + vdev_geom.c \ + zfs_acl.c \ + zfs_ctldir.c \ + zfs_dir.c \ + zfs_ioctl_compat.c \ + zfs_ioctl_os.c \ + zfs_log.c \ + zfs_racct.c \ + zfs_replay.c \ + zfs_vfsops.c \ + zfs_vnops_os.c \ + zfs_znode.c \ + zio_crypt.c \ + zvol_os.c + +#unicode +SRCS+= uconv.c \ + u8_textprep.c + +#zcommon +SRCS+= zfeature_common.c \ + zfs_comutil.c \ + zfs_deleg.c \ + zfs_fletcher.c \ + zfs_fletcher_avx512.c \ + zfs_fletcher_intel.c \ + zfs_fletcher_sse.c \ + zfs_fletcher_superscalar.c \ + zfs_fletcher_superscalar4.c \ + zfs_namecheck.c \ + zfs_prop.c \ + zpool_prop.c \ + zprop_common.c + +#zfs +SRCS+= abd.c \ + aggsum.c \ + arc.c \ + arc_os.c \ + blkptr.c \ + bplist.c \ + bpobj.c \ + cityhash.c \ + dbuf.c \ + dbuf_stats.c \ + bptree.c \ + bqueue.c \ + dataset_kstats.c \ + ddt.c \ + ddt_zap.c \ + dmu.c \ + dmu_diff.c \ + dmu_object.c \ + dmu_objset.c \ + dmu_recv.c \ + dmu_redact.c \ + dmu_send.c \ + dmu_traverse.c \ + dmu_tx.c \ + dmu_zfetch.c \ + dnode.c \ + dnode_sync.c \ + dsl_dataset.c \ + dsl_deadlist.c \ + dsl_deleg.c \ + dsl_bookmark.c \ + dsl_dir.c \ + dsl_crypt.c \ + dsl_destroy.c \ + dsl_pool.c \ + dsl_prop.c \ + dsl_scan.c \ + dsl_synctask.c \ + dsl_userhold.c \ + fm.c \ + gzip.c \ + lzjb.c \ + lz4.c \ + metaslab.c \ + mmp.c \ + multilist.c \ + objlist.c \ + pathname.c \ + range_tree.c \ + refcount.c \ + rrwlock.c \ + sa.c \ + sha256.c \ + skein_zfs.c \ + spa.c \ + spa_boot.c \ + spa_checkpoint.c \ + spa_config.c \ + spa_errlog.c \ + spa_history.c \ + spa_log_spacemap.c \ + spa_misc.c \ + spa_stats.c \ + space_map.c \ + space_reftree.c \ + txg.c \ + uberblock.c \ + unique.c \ + vdev.c \ + vdev_cache.c \ + vdev_draid.c \ + vdev_draid_rand.c \ + vdev_indirect.c \ + vdev_indirect_births.c \ + vdev_indirect_mapping.c \ + vdev_initialize.c \ + vdev_label.c \ + vdev_mirror.c \ + vdev_missing.c \ + vdev_queue.c \ + vdev_raidz.c \ + vdev_raidz_math.c \ + vdev_raidz_math_scalar.c \ + vdev_raidz_math_avx2.c \ + vdev_raidz_math_avx512bw.c \ + vdev_raidz_math_avx512f.c \ + vdev_raidz_math_sse2.c \ + vdev_raidz_math_ssse3.c \ + vdev_rebuild.c \ + vdev_removal.c \ + vdev_root.c \ + vdev_trim.c \ + zap.c \ + zap_leaf.c \ + zap_micro.c \ + zcp.c \ + zcp_get.c \ + zcp_global.c \ + zcp_iter.c \ + zcp_set.c \ + zcp_synctask.c \ + zfeature.c \ + zfs_byteswap.c \ + zfs_debug.c \ + zfs_file_os.c \ + zfs_fm.c \ + zfs_fuid.c \ + zfs_ioctl.c \ + zfs_onexit.c \ + zfs_quota.c \ + zfs_ratelimit.c \ + zfs_rlock.c \ + zfs_sa.c \ + zfs_vnops.c \ + zil.c \ + zio.c \ + zio_checksum.c \ + zio_compress.c \ + zio_inject.c \ + zle.c \ + zrlock.c \ + zthr.c \ + zvol.c + +SRCS+= zfs_zstd.c \ - zstd.c ++ zstd.c \ ++ zstd_sparc.c + +.include + +CFLAGS+= -include ${SRCTOP}/sys/cddl/compat/opensolaris/sys/debug_compat.h +CFLAGS+= -include ${INCDIR}/os/freebsd/spl/sys/ccompile.h +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/static_ccompile.h + +CWARNFLAGS+= ${OPENZFS_CWARNFLAGS} + +CFLAGS.gcc+= -Wno-pointer-to-int-cast + +CFLAGS.lapi.c= -Wno-cast-qual +CFLAGS.lcompat.c= -Wno-cast-qual +CFLAGS.lobject.c= -Wno-cast-qual +CFLAGS.ltable.c= -Wno-cast-qual +CFLAGS.lvm.c= -Wno-cast-qual +CFLAGS.nvpair.c= -Wno-cast-qual -DHAVE_RPC_TYPES +CFLAGS.spl_string.c= -Wno-cast-qual +CFLAGS.spl_vm.c= -Wno-cast-qual +CFLAGS.spl_zlib.c= -Wno-cast-qual +CFLAGS.abd.c= -Wno-cast-qual +CFLAGS.zfs_log.c= -Wno-cast-qual +CFLAGS.zfs_vnops_os.c= -Wno-pointer-arith +CFLAGS.u8_textprep.c= -Wno-cast-qual +CFLAGS.zfs_fletcher.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zfs_fletcher_intel.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zfs_fletcher_sse.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zfs_fletcher_avx512.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zprop_common.c= -Wno-cast-qual +CFLAGS.ddt.c= -Wno-cast-qual +CFLAGS.dmu.c= -Wno-cast-qual +CFLAGS.dmu_traverse.c= -Wno-cast-qual +CFLAGS.dsl_dir.c= -Wno-cast-qual +CFLAGS.dsl_deadlist.c= -Wno-cast-qual +CFLAGS.dsl_prop.c= -Wno-cast-qual +CFLAGS.fm.c= -Wno-cast-qual +CFLAGS.lz4.c= -Wno-cast-qual +CFLAGS.spa.c= -Wno-cast-qual +CFLAGS.spa_misc.c= -Wno-cast-qual +CFLAGS.sysctl_os.c= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h +CFLAGS.vdev_draid.c= -Wno-cast-qual +CFLAGS.vdev_raidz.c= -Wno-cast-qual +CFLAGS.vdev_raidz_math.c= -Wno-cast-qual +CFLAGS.vdev_raidz_math_scalar.c= -Wno-cast-qual +CFLAGS.vdev_raidz_math_avx2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier +CFLAGS.vdev_raidz_math_avx512f.c= -Wno-cast-qual -Wno-duplicate-decl-specifier +CFLAGS.vdev_raidz_math_sse2.c= -Wno-cast-qual -Wno-duplicate-decl-specifier +CFLAGS.zap_leaf.c= -Wno-cast-qual +CFLAGS.zap_micro.c= -Wno-cast-qual +CFLAGS.zcp.c= -Wno-cast-qual +CFLAGS.zfs_fm.c= -Wno-cast-qual +CFLAGS.zfs_ioctl.c= -Wno-cast-qual +CFLAGS.zil.c= -Wno-cast-qual +CFLAGS.zio.c= -Wno-cast-qual +CFLAGS.zrlock.c= -Wno-cast-qual +CFLAGS.zfs_zstd.c= -Wno-cast-qual -Wno-pointer-arith +CFLAGS.zstd.c= -U__BMI__ -fno-tree-vectorize +.if ${MACHINE_CPUARCH} == "aarch64" +CFLAGS.zstd.c+= -include ${SRCDIR}/zstd/include/aarch64_compat.h +.endif diff --cc sys/modules/zfs/zfs_config.h index ebad45d3def7,000000000000..fa3d4feec5de mode 100644,000000..100644 --- a/sys/modules/zfs/zfs_config.h +++ b/sys/modules/zfs/zfs_config.h @@@ -1,852 -1,0 +1,852 @@@ +/* + * $FreeBSD$ + */ + +/* zfs_config.h. Generated from zfs_config.h.in by configure. */ +/* zfs_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if translation of program messages to the user's native + language is requested. */ +/* #undef ENABLE_NLS */ + +/* bio_end_io_t wants 1 arg */ +/* #undef HAVE_1ARG_BIO_END_IO_T */ + +/* lookup_bdev() wants 1 arg */ +/* #undef HAVE_1ARG_LOOKUP_BDEV */ + +/* submit_bio() wants 1 arg */ +/* #undef HAVE_1ARG_SUBMIT_BIO */ + +/* bdi_setup_and_register() wants 2 args */ +/* #undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 2 args */ +/* #undef HAVE_2ARGS_VFS_GETATTR */ + +/* zlib_deflate_workspacesize() wants 2 args */ +/* #undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE */ + +/* bdi_setup_and_register() wants 3 args */ +/* #undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER */ + +/* vfs_getattr wants 3 args */ +/* #undef HAVE_3ARGS_VFS_GETATTR */ + +/* vfs_getattr wants 4 args */ +/* #undef HAVE_4ARGS_VFS_GETATTR */ + +/* kernel has access_ok with 'type' parameter */ +/* #undef HAVE_ACCESS_OK_TYPE */ + +/* posix_acl has refcount_t */ +/* #undef HAVE_ACL_REFCOUNT */ + +/* Define if host toolchain supports AES */ +#define HAVE_AES 1 + +#ifdef __amd64__ +#ifndef RESCUE +/* Define if host toolchain supports AVX */ +#define HAVE_AVX 1 +#endif + +/* Define if host toolchain supports AVX2 */ +#define HAVE_AVX2 1 + +/* Define if host toolchain supports AVX512BW */ +#define HAVE_AVX512BW 1 + +/* Define if host toolchain supports AVX512CD */ +#define HAVE_AVX512CD 1 + +/* Define if host toolchain supports AVX512DQ */ +#define HAVE_AVX512DQ 1 + +/* Define if host toolchain supports AVX512ER */ +#define HAVE_AVX512ER 1 + +/* Define if host toolchain supports AVX512F */ +#define HAVE_AVX512F 1 + +/* Define if host toolchain supports AVX512IFMA */ +#define HAVE_AVX512IFMA 1 + +/* Define if host toolchain supports AVX512PF */ +#define HAVE_AVX512PF 1 + +/* Define if host toolchain supports AVX512VBMI */ +#define HAVE_AVX512VBMI 1 + +/* Define if host toolchain supports AVX512VL */ +#define HAVE_AVX512VL 1 +#endif + +/* bdev_check_media_change() exists */ +/* #undef HAVE_BDEV_CHECK_MEDIA_CHANGE */ + +/* bdev_whole() is available */ +/* #undef HAVE_BDEV_WHOLE */ + +/* bio->bi_bdev->bd_disk exists */ +/* #undef HAVE_BIO_BDEV_DISK */ + +/* bio->bi_opf is defined */ +/* #undef HAVE_BIO_BI_OPF */ + +/* bio->bi_status exists */ +/* #undef HAVE_BIO_BI_STATUS */ + +/* bio has bi_iter */ +/* #undef HAVE_BIO_BVEC_ITER */ + +/* bio_*_io_acct() available */ +/* #undef HAVE_BIO_IO_ACCT */ + +/* bio_max_segs() is implemented */ +/* #undef HAVE_BIO_MAX_SEGS */ + +/* bio_set_dev() is available */ +/* #undef HAVE_BIO_SET_DEV */ + +/* bio_set_dev() GPL-only */ +/* #undef HAVE_BIO_SET_DEV_GPL_ONLY */ + +/* bio_set_op_attrs is available */ +/* #undef HAVE_BIO_SET_OP_ATTRS */ + +/* blkdev_reread_part() exists */ +/* #undef HAVE_BLKDEV_REREAD_PART */ + +/* blkg_tryget() is available */ +/* #undef HAVE_BLKG_TRYGET */ + +/* blkg_tryget() GPL-only */ +/* #undef HAVE_BLKG_TRYGET_GPL_ONLY */ + ++/* blk_alloc_disk() exists */ ++/* #undef HAVE_BLK_ALLOC_DISK */ ++ +/* blk_alloc_queue() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN */ + +/* blk_alloc_queue_rh() expects request function */ +/* #undef HAVE_BLK_ALLOC_QUEUE_REQUEST_FN_RH */ + +/* blk queue backing_dev_info is dynamic */ +/* #undef HAVE_BLK_QUEUE_BDI_DYNAMIC */ + +/* blk_queue_flag_clear() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_CLEAR */ + +/* blk_queue_flag_set() exists */ +/* #undef HAVE_BLK_QUEUE_FLAG_SET */ + +/* blk_queue_flush() is available */ +/* #undef HAVE_BLK_QUEUE_FLUSH */ + +/* blk_queue_flush() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY */ + +/* blk_queue_secdiscard() is available */ +/* #undef HAVE_BLK_QUEUE_SECDISCARD */ + +/* blk_queue_secure_erase() is available */ +/* #undef HAVE_BLK_QUEUE_SECURE_ERASE */ + ++/* blk_queue_update_readahead() exists */ ++/* #undef HAVE_BLK_QUEUE_UPDATE_READAHEAD */ ++ +/* blk_queue_write_cache() exists */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE */ + +/* blk_queue_write_cache() is GPL-only */ +/* #undef HAVE_BLK_QUEUE_WRITE_CACHE_GPL_ONLY */ + +/* Define if revalidate_disk() in block_device_operations */ +/* #undef HAVE_BLOCK_DEVICE_OPERATIONS_REVALIDATE_DISK */ + +/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ +/* #undef HAVE_CFLOCALECOPYCURRENT */ + *** 717 LINES SKIPPED ***