git: 7a7741af18d6 - main - zfs: merge openzfs/zfs@b10992582

From: Martin Matuska <mm_at_FreeBSD.org>
Date: Fri, 11 Oct 2024 06:48:36 UTC
The branch main has been updated by mm:

URL: https://cgit.FreeBSD.org/src/commit/?id=7a7741af18d6c8a804cc643cb7ecda9d730c6aa6

commit 7a7741af18d6c8a804cc643cb7ecda9d730c6aa6
Merge: 3e501ef89667 3a9fca901b44
Author:     Martin Matuska <mm@FreeBSD.org>
AuthorDate: 2024-10-11 06:39:18 +0000
Commit:     Martin Matuska <mm@FreeBSD.org>
CommitDate: 2024-10-11 06:43:49 +0000

    zfs: merge openzfs/zfs@b10992582
    
    Notable upstream pull request merges:
     #9416  -multiple zio_compress: introduce max size threshold
     #10018 a10e552b9 Adding Direct IO Support
     #15147 e419a63bf xattr dataset prop: change defaults to sa
     #15454 7e957fde7 send/recv: open up additional stream feature flags
     #15810 0d77e738e Defer resilver only when progress is above a threshold
     #15921 3cf2bfa57 Allocate zap_attribute_t from kmem instead of stack
     #16483 -multiple dmu_objset: replace dnode_hash impl with cityhash4
     #16485 8be2f4c3d zio_resume: log when unsuspending the pool
     #16491 88433e640 sys/types32.h: Remove struct timeval32 from libspl header
     #16496 f245541e2 zfs_file: implement zfs_file_deallocate for FreeBSD 14
     #16511 308f7c2f1 Fix an uninitialized data access
     #16529 29c9e6c32 Fix handling of DNS names with '-' in them for sharenfs
     #16531 ddf5f34f0 Avoid fault diagnosis if multiple vdevs have errors
     #16539 6f50f8e16 zfs_log: add flex array fields to log record structs
     #16546 d40d40913 Evicting too many bytes from MFU metadata
     #16551 3014dcb76 Reduce and handle EAGAIN errors on AIO label reads
     #16554 80645d658 FreeBSD: restore zfs_znode_update_vfs()
     #16565 832f66b21 FreeBSD: Sync taskq_cancel_id() returns with Linux
     #16567 48d1be254 Properly release key in spa_keystore_dsl_key_hold_dd()
     #16569 141368a4b Restrict raidz faulted vdev count
     #16583 c84a37ae9 lua: add flex array field to TString type
     #16584 86737c592 Avoid computing strlen() inside loops
     #16587 d34d4f97a snapdir: add 'disabled' value to make .zfs inaccessible
     #16593 224393a32 feature: large_microzap
     #16597 412105977 Temporarily disable Direct IO by default
     #16605 4ebe674d9 ARC: Cache arc_c value during arc_evict()
    
    Backported pull request merges:
     #16613 ab777f436 Return boolean_t in inline functions of
                      lib/libspl/include/sys/uio.h
     #16616 efeb60b86 FreeBSD: ignore some includes when not building kernel
     #16635 ---TBD--- zdb: fix printf format in dump_zap()
    
    Obtained from:  OpenZFS
    OpenZFS commit: b109925820fb79db3e37670c159977f03edd950f
    OpenZFS tag:    2.3.0-rc1

 cddl/lib/libzdb/Makefile                           |   1 +
 cddl/lib/libzfs_core/Makefile                      |   1 +
 cddl/lib/libzfsbootenv/Makefile                    |   1 +
 cddl/lib/libzpool/Makefile                         |  18 +-
 cddl/lib/libzutil/Makefile                         |   1 +
 cddl/lib/pam_zfs_key/Makefile                      |   1 +
 cddl/share/zfs/compatibility.d/Makefile            |  12 +-
 stand/libsa/zfs/Makefile.inc                       |   2 +-
 sys/conf/files                                     |   4 +-
 sys/contrib/openzfs/.github/CONTRIBUTING.md        |  18 +-
 .../.github/workflows/build-dependencies.txt       |  57 ---
 .../.github/workflows/checkstyle-dependencies.txt  |   5 -
 .../openzfs/.github/workflows/checkstyle.yaml      |  23 +-
 sys/contrib/openzfs/.github/workflows/codeql.yml   |  10 +-
 .../openzfs/.github/workflows/scripts/README.md    |  14 +
 .../.github/workflows/scripts/generate-ci-type.py  | 107 +++++
 .../.github/workflows/scripts/generate-summary.sh  | 119 ------
 .../.github/workflows/scripts/merge_summary.awk    | 109 +++++
 .../.github/workflows/scripts/qemu-1-setup.sh      |  91 ++++
 .../.github/workflows/scripts/qemu-2-start.sh      | 213 +++++++++
 .../.github/workflows/scripts/qemu-3-deps.sh       | 221 ++++++++++
 .../.github/workflows/scripts/qemu-4-build.sh      | 153 +++++++
 .../.github/workflows/scripts/qemu-5-setup.sh      | 121 ++++++
 .../.github/workflows/scripts/qemu-6-tests.sh      | 105 +++++
 .../.github/workflows/scripts/qemu-7-prepare.sh    | 123 ++++++
 .../.github/workflows/scripts/qemu-8-summary.sh    |  71 +++
 .../workflows/scripts/qemu-9-summary-page.sh       |  57 +++
 .../workflows/scripts/setup-dependencies.sh        |  88 ----
 .../.github/workflows/scripts/setup-functional.sh  |  24 --
 .../openzfs/.github/workflows/zfs-linux-tests.yml  | 124 ------
 .../openzfs/.github/workflows/zfs-linux.yml        |  64 ---
 sys/contrib/openzfs/.github/workflows/zfs-qemu.yml | 175 ++++++++
 sys/contrib/openzfs/.github/workflows/zloop.yml    |  77 ++++
 sys/contrib/openzfs/.mailmap                       |   1 +
 sys/contrib/openzfs/AUTHORS                        |   4 +
 sys/contrib/openzfs/META                           |   8 +-
 sys/contrib/openzfs/cmd/arc_summary                |   2 +-
 sys/contrib/openzfs/cmd/arcstat.in                 | 297 +++++++++----
 sys/contrib/openzfs/cmd/zdb/zdb.c                  | 144 ++++---
 sys/contrib/openzfs/cmd/zdb/zdb_il.c               |   6 +-
 sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c | 101 +++--
 sys/contrib/openzfs/cmd/zhack.c                    |  17 +-
 sys/contrib/openzfs/cmd/zpool/Makefile.am          |   9 +-
 .../openzfs/cmd/zpool/compatibility.d/grub2-2.06   |  23 +
 .../zpool/compatibility.d/{grub2 => grub2-2.12}    |   2 +-
 .../openzfs/cmd/zpool/compatibility.d/openzfs-2.3  |  45 ++
 sys/contrib/openzfs/cmd/zpool/zpool_main.c         |  30 +-
 .../openzfs/cmd/zstream/zstream_recompress.c       |   3 +-
 sys/contrib/openzfs/cmd/zstream/zstream_redup.c    |   4 +-
 sys/contrib/openzfs/cmd/ztest.c                    |  78 +++-
 sys/contrib/openzfs/config/ax_compare_version.m4   | 177 ++++++++
 sys/contrib/openzfs/config/deb.am                  |   2 +
 sys/contrib/openzfs/config/intlmacosx.m4           |  72 ----
 sys/contrib/openzfs/config/kernel-acl.m4           | 215 +---------
 sys/contrib/openzfs/config/kernel-aio-fsync.m4     |  23 -
 sys/contrib/openzfs/config/kernel-assign_str.m4    |  62 +++
 sys/contrib/openzfs/config/kernel-bdi.m4           |  81 ----
 sys/contrib/openzfs/config/kernel-bio.m4           | 313 +-------------
 sys/contrib/openzfs/config/kernel-blk-queue.m4     | 183 +-------
 sys/contrib/openzfs/config/kernel-blkdev.m4        |  22 +-
 sys/contrib/openzfs/config/kernel-clear-inode.m4   |  39 --
 .../openzfs/config/kernel-config-defined.m4        |  15 -
 sys/contrib/openzfs/config/kernel-current-time.m4  |  26 --
 sys/contrib/openzfs/config/kernel-dentry-alias.m4  |  30 --
 .../openzfs/config/kernel-dentry-operations.m4     | 135 ------
 sys/contrib/openzfs/config/kernel-dirty-inode.m4   |  29 --
 .../openzfs/config/kernel-encode-fh-inode.m4       |  27 --
 sys/contrib/openzfs/config/kernel-evict-inode.m4   |  24 --
 sys/contrib/openzfs/config/kernel-fadvise.m4       |  23 -
 sys/contrib/openzfs/config/kernel-fallocate.m4     |  44 --
 sys/contrib/openzfs/config/kernel-file-dentry.m4   |  24 --
 sys/contrib/openzfs/config/kernel-file-inode.m4    |  23 -
 sys/contrib/openzfs/config/kernel-file.m4          |  31 ++
 sys/contrib/openzfs/config/kernel-filemap.m4       |  27 --
 sys/contrib/openzfs/config/kernel-fsync.m4         |  53 ---
 .../openzfs/config/kernel-generic_fillattr.m4      |   4 +
 .../openzfs/config/kernel-generic_io_acct.m4       |  29 --
 .../openzfs/config/kernel-generic_readlink.m4      |  25 --
 sys/contrib/openzfs/config/kernel-genhd-flags.m4   |  21 +-
 sys/contrib/openzfs/config/kernel-get-link.m4      | 104 -----
 .../openzfs/config/kernel-global_page_state.m4     | 128 ------
 sys/contrib/openzfs/config/kernel-group-info.m4    |  22 -
 sys/contrib/openzfs/config/kernel-hotplug.m4       |  26 --
 .../openzfs/config/kernel-in-compat-syscall.m4     |  24 --
 sys/contrib/openzfs/config/kernel-inode-getattr.m4 |  26 --
 sys/contrib/openzfs/config/kernel-inode-lock.m4    |  24 --
 .../openzfs/config/kernel-inode-permission.m4      |   2 +
 .../openzfs/config/kernel-inode-set-flags.m4       |  22 -
 .../openzfs/config/kernel-inode-set-iversion.m4    |  23 -
 sys/contrib/openzfs/config/kernel-inode-setattr.m4 |  22 -
 sys/contrib/openzfs/config/kernel-inode-times.m4   |  23 -
 sys/contrib/openzfs/config/kernel-kmem-cache.m4    |  41 --
 sys/contrib/openzfs/config/kernel-kmem.m4          |  27 +-
 sys/contrib/openzfs/config/kernel-kstrtoul.m4      |  21 -
 sys/contrib/openzfs/config/kernel-kthread.m4       |  37 +-
 sys/contrib/openzfs/config/kernel-ktime.m4         |  55 ---
 sys/contrib/openzfs/config/kernel-lseek-execute.m4 |  27 --
 .../openzfs/config/kernel-make-request-fn.m4       |  42 +-
 sys/contrib/openzfs/config/kernel-mkdir.m4         |  11 +-
 sys/contrib/openzfs/config/kernel-mm-page-flags.m4 |  24 ++
 sys/contrib/openzfs/config/kernel-mm-pagemap.m4    |   4 +-
 sys/contrib/openzfs/config/kernel-percpu.m4        |  56 ---
 sys/contrib/openzfs/config/kernel-put-link.m4      |  61 ---
 sys/contrib/openzfs/config/kernel-rename.m4        |  64 +--
 sys/contrib/openzfs/config/kernel-rw.m4            |  69 ---
 sys/contrib/openzfs/config/kernel-rwsem.m4         |  60 ---
 sys/contrib/openzfs/config/kernel-sched.m4         |  53 ---
 .../openzfs/config/kernel-setattr-prepare.m4       |   2 +
 sys/contrib/openzfs/config/kernel-shrink.m4        | 163 +------
 sys/contrib/openzfs/config/kernel-signal-stop.m4   |  21 -
 sys/contrib/openzfs/config/kernel-special-state.m4 |  21 -
 sys/contrib/openzfs/config/kernel-strlcpy.m4       |  25 +-
 sys/contrib/openzfs/config/kernel-super-userns.m4  |  25 --
 sys/contrib/openzfs/config/kernel-symlink.m4       |   2 +
 sys/contrib/openzfs/config/kernel-timer.m4         |  75 ----
 sys/contrib/openzfs/config/kernel-tmpfile.m4       |   4 -
 sys/contrib/openzfs/config/kernel-user-ns-inum.m4  |  23 -
 .../openzfs/config/kernel-userns-capabilities.m4   |  27 --
 sys/contrib/openzfs/config/kernel-vfs-direct_IO.m4 |  56 +--
 .../config/kernel-vfs-extended-file_range.m4       |  50 ---
 .../openzfs/config/kernel-vfs-file_range.m4        |  30 --
 sys/contrib/openzfs/config/kernel-vfs-getattr.m4   |  86 ----
 .../openzfs/config/kernel-vfs-invalidate_folio.m4  |  33 ++
 sys/contrib/openzfs/config/kernel-vfs-iov_iter.m4  | 163 ++-----
 sys/contrib/openzfs/config/kernel-vfs-iterate.m4   |  83 ----
 .../openzfs/config/kernel-vfs-release_folio.m4     |  32 ++
 .../openzfs/config/kernel-vfs-rw-iterate.m4        |  80 ----
 sys/contrib/openzfs/config/kernel-wait.m4          |  99 -----
 sys/contrib/openzfs/config/kernel-xattr-handler.m4 | 322 +-------------
 sys/contrib/openzfs/config/kernel-zlib.m4          |  26 --
 sys/contrib/openzfs/config/kernel.m4               | 158 +++----
 sys/contrib/openzfs/configure.ac                   |   2 +
 sys/contrib/openzfs/contrib/Makefile.am            |   1 +
 sys/contrib/openzfs/contrib/debian/Makefile.am     |  48 +++
 sys/contrib/openzfs/contrib/debian/not-installed   |   1 -
 sys/contrib/openzfs/contrib/debian/rules.in        |   8 +-
 sys/contrib/openzfs/include/cityhash.h             |   7 +
 .../openzfs/include/os/freebsd/spl/sys/mutex.h     |   1 +
 .../openzfs/include/os/freebsd/spl/sys/param.h     |   1 +
 .../openzfs/include/os/freebsd/spl/sys/simd.h      |   3 +
 .../openzfs/include/os/freebsd/spl/sys/uio.h       |  31 +-
 .../openzfs/include/os/freebsd/zfs/sys/abd_os.h    |  15 +
 .../include/os/freebsd/zfs/sys/zfs_ctldir.h        |   2 +-
 .../include/os/freebsd/zfs/sys/zfs_vfsops_os.h     |   3 +-
 .../include/os/freebsd/zfs/sys/zfs_znode_impl.h    |   2 +-
 sys/contrib/openzfs/include/os/linux/Makefile.am   |   1 -
 .../include/os/linux/kernel/linux/blkdev_compat.h  | 229 +---------
 .../include/os/linux/kernel/linux/dcache_compat.h  |   6 -
 .../include/os/linux/kernel/linux/kmap_compat.h    |   2 +
 .../include/os/linux/kernel/linux/mm_compat.h      |  14 +
 .../include/os/linux/kernel/linux/page_compat.h    |  56 ---
 .../openzfs/include/os/linux/kernel/linux/simd.h   |   4 +
 .../include/os/linux/kernel/linux/simd_aarch64.h   |  10 -
 .../include/os/linux/kernel/linux/simd_powerpc.h   |  11 -
 .../include/os/linux/kernel/linux/vfs_compat.h     | 235 +---------
 .../include/os/linux/kernel/linux/xattr_compat.h   | 106 +----
 .../openzfs/include/os/linux/spl/sys/condvar.h     |   4 +-
 .../openzfs/include/os/linux/spl/sys/cred.h        |   4 -
 .../openzfs/include/os/linux/spl/sys/file.h        |  11 -
 .../openzfs/include/os/linux/spl/sys/kmem_cache.h  |   3 +-
 .../openzfs/include/os/linux/spl/sys/signal.h      |   3 -
 .../openzfs/include/os/linux/spl/sys/string.h      |   7 -
 .../openzfs/include/os/linux/spl/sys/taskq.h       |   6 +-
 .../openzfs/include/os/linux/spl/sys/thread.h      |   7 -
 .../openzfs/include/os/linux/spl/sys/time.h        |  28 --
 .../openzfs/include/os/linux/spl/sys/timer.h       |  20 -
 .../openzfs/include/os/linux/spl/sys/types.h       |   6 +
 sys/contrib/openzfs/include/os/linux/spl/sys/uio.h |  47 +-
 .../openzfs/include/os/linux/spl/sys/wait.h        |  24 --
 .../openzfs/include/os/linux/spl/sys/wmsum.h       |   9 -
 .../openzfs/include/os/linux/zfs/sys/abd_os.h      |   3 +
 .../include/os/linux/zfs/sys/trace_dbgmsg.h        |   3 +-
 .../openzfs/include/os/linux/zfs/sys/trace_dbuf.h  |  29 +-
 .../openzfs/include/os/linux/zfs/sys/zfs_ctldir.h  |   2 +-
 .../include/os/linux/zfs/sys/zfs_vfsops_os.h       |   3 +-
 .../include/os/linux/zfs/sys/zfs_vnops_os.h        |   3 +-
 .../include/os/linux/zfs/sys/zfs_znode_impl.h      |  31 --
 sys/contrib/openzfs/include/os/linux/zfs/sys/zpl.h |  86 +---
 sys/contrib/openzfs/include/sys/abd.h              |   7 +
 sys/contrib/openzfs/include/sys/abd_impl.h         |  14 +-
 sys/contrib/openzfs/include/sys/arc.h              |   3 +-
 sys/contrib/openzfs/include/sys/dbuf.h             |  29 +-
 sys/contrib/openzfs/include/sys/dmu.h              |  14 +-
 sys/contrib/openzfs/include/sys/dmu_impl.h         |  34 +-
 sys/contrib/openzfs/include/sys/dmu_objset.h       |   1 +
 sys/contrib/openzfs/include/sys/fm/fs/zfs.h        |   2 +
 sys/contrib/openzfs/include/sys/fs/zfs.h           |  15 +
 sys/contrib/openzfs/include/sys/sa_impl.h          |   4 +-
 sys/contrib/openzfs/include/sys/spa.h              |  12 +
 sys/contrib/openzfs/include/sys/uio_impl.h         |  37 ++
 sys/contrib/openzfs/include/sys/vdev_impl.h        |  10 +
 sys/contrib/openzfs/include/sys/zap.h              |  16 +-
 sys/contrib/openzfs/include/sys/zap_impl.h         |   7 +-
 sys/contrib/openzfs/include/sys/zfs_file.h         |   2 +-
 sys/contrib/openzfs/include/sys/zfs_ioctl.h        |  72 ++--
 sys/contrib/openzfs/include/sys/zfs_racct.h        |   7 +-
 sys/contrib/openzfs/include/sys/zfs_znode.h        |   4 +-
 sys/contrib/openzfs/include/sys/zil.h              |  30 +-
 sys/contrib/openzfs/include/sys/zio.h              |   5 +
 sys/contrib/openzfs/include/sys/zio_compress.h     |   3 +-
 sys/contrib/openzfs/include/sys/zio_impl.h         |   7 +-
 sys/contrib/openzfs/include/zfeature_common.h      |   3 +
 sys/contrib/openzfs/lib/libnvpair/libnvpair.abi    | 197 ++++++++-
 sys/contrib/openzfs/lib/libshare/os/freebsd/nfs.c  |   4 +-
 sys/contrib/openzfs/lib/libspl/include/sys/simd.h  |   3 +
 sys/contrib/openzfs/lib/libspl/include/sys/uio.h   |  26 ++
 sys/contrib/openzfs/lib/libuutil/libuutil.abi      | 200 ++++++++-
 sys/contrib/openzfs/lib/libzfs/libzfs.abi          | 212 ++++++++-
 sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c   |   8 +-
 sys/contrib/openzfs/lib/libzfs/libzfs_util.c       |   8 +-
 .../openzfs/lib/libzfs_core/libzfs_core.abi        | 196 ++++++++-
 sys/contrib/openzfs/lib/libzpool/Makefile.am       |  15 +-
 sys/contrib/openzfs/lib/libzpool/abd_os.c          |  64 +++
 sys/contrib/openzfs/lib/libzpool/arc_os.c          |  87 ++++
 sys/contrib/openzfs/lib/libzpool/kernel.c          |  30 +-
 .../libzpool/vdev_label_os.c}                      |  39 +-
 sys/contrib/openzfs/lib/libzpool/zfs_debug.c       | 106 +++++
 sys/contrib/openzfs/lib/libzpool/zfs_racct.c       |  38 ++
 sys/contrib/openzfs/lib/libzstd/Makefile.am        |   2 +
 sys/contrib/openzfs/lib/libzutil/zutil_import.c    |  17 +-
 sys/contrib/openzfs/man/man1/arcstat.1             | 166 ++++++++
 sys/contrib/openzfs/man/man4/zfs.4                 |  62 ++-
 sys/contrib/openzfs/man/man7/zfsconcepts.7         |   2 +-
 sys/contrib/openzfs/man/man7/zfsprops.7            |  99 ++++-
 sys/contrib/openzfs/man/man7/zpool-features.7      |  69 ++-
 sys/contrib/openzfs/man/man8/zfs-send.8            |   6 +-
 sys/contrib/openzfs/man/man8/zpool-events.8        |  14 +-
 sys/contrib/openzfs/man/man8/zpool-status.8        |  11 +-
 sys/contrib/openzfs/module/Kbuild.in               |   5 +-
 sys/contrib/openzfs/module/Makefile.bsd            |   4 +-
 sys/contrib/openzfs/module/lua/lobject.h           |  21 +-
 sys/contrib/openzfs/module/lua/lstate.h            |   2 +-
 sys/contrib/openzfs/module/lua/lstring.c           |   2 +-
 sys/contrib/openzfs/module/lua/lstring.h           |   2 +-
 .../openzfs/module/os/freebsd/spl/spl_taskq.c      |   4 +-
 .../openzfs/module/os/freebsd/spl/spl_uio.c        | 201 +++++++++
 sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 169 +++++++-
 .../openzfs/module/os/freebsd/zfs/vdev_file.c      |  11 +-
 .../openzfs/module/os/freebsd/zfs/zfs_acl.c        |   2 +-
 .../openzfs/module/os/freebsd/zfs/zfs_debug.c      |  53 +--
 .../openzfs/module/os/freebsd/zfs/zfs_dir.c        |  31 +-
 .../openzfs/module/os/freebsd/zfs/zfs_file_os.c    |  26 ++
 .../openzfs/module/os/freebsd/zfs/zfs_racct.c      |   8 +-
 .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c     |  13 +-
 .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c   |  95 ++++-
 .../os/freebsd/zfs/{zfs_znode.c => zfs_znode_os.c} | 374 +---------------
 .../openzfs/module/os/freebsd/zfs/zvol_os.c        |   1 +
 .../openzfs/module/os/linux/spl/spl-condvar.c      |  47 +-
 sys/contrib/openzfs/module/os/linux/spl/spl-cred.c |  21 +-
 .../openzfs/module/os/linux/spl/spl-generic.c      |  30 +-
 .../openzfs/module/os/linux/spl/spl-kmem-cache.c   |  23 +-
 sys/contrib/openzfs/module/os/linux/spl/spl-kmem.c |   2 -
 sys/contrib/openzfs/module/os/linux/spl/spl-proc.c |   2 +-
 .../openzfs/module/os/linux/spl/spl-shrinker.c     |  46 +-
 .../openzfs/module/os/linux/spl/spl-taskq.c        |  22 +-
 .../openzfs/module/os/linux/spl/spl-thread.c       |  26 +-
 sys/contrib/openzfs/module/os/linux/spl/spl-vmem.c |   1 -
 sys/contrib/openzfs/module/os/linux/spl/spl-zlib.c |   1 -
 sys/contrib/openzfs/module/os/linux/spl/spl-zone.c |  20 +-
 sys/contrib/openzfs/module/os/linux/zfs/abd_os.c   | 240 +++++++++--
 sys/contrib/openzfs/module/os/linux/zfs/arc_os.c   |  47 --
 sys/contrib/openzfs/module/os/linux/zfs/policy.c   |   9 -
 .../openzfs/module/os/linux/zfs/vdev_disk.c        |  71 +--
 .../openzfs/module/os/linux/zfs/vdev_file.c        |   9 +-
 sys/contrib/openzfs/module/os/linux/zfs/zfs_acl.c  |   2 +-
 .../openzfs/module/os/linux/zfs/zfs_ctldir.c       |  25 +-
 .../openzfs/module/os/linux/zfs/zfs_debug.c        |  40 --
 sys/contrib/openzfs/module/os/linux/zfs/zfs_dir.c  |  32 +-
 .../openzfs/module/os/linux/zfs/zfs_file_os.c      |  74 +---
 .../openzfs/module/os/linux/zfs/zfs_ioctl_os.c     |   6 +
 .../openzfs/module/os/linux/zfs/zfs_racct.c        |  29 +-
 sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c  | 308 ++++++++++++-
 .../openzfs/module/os/linux/zfs/zfs_vfsops.c       | 117 +----
 .../openzfs/module/os/linux/zfs/zfs_vnops_os.c     | 152 +++++--
 .../os/linux/zfs/{zfs_znode.c => zfs_znode_os.c}   | 411 +-----------------
 .../openzfs/module/os/linux/zfs/zpl_ctldir.c       |  90 +---
 .../openzfs/module/os/linux/zfs/zpl_export.c       |  38 +-
 sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c | 336 +++------------
 .../openzfs/module/os/linux/zfs/zpl_file_range.c   |   8 +-
 .../openzfs/module/os/linux/zfs/zpl_inode.c        | 173 +++-----
 .../openzfs/module/os/linux/zfs/zpl_super.c        |  13 +-
 .../openzfs/module/os/linux/zfs/zpl_xattr.c        | 110 +----
 sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c  |  72 +---
 sys/contrib/openzfs/module/zcommon/cityhash.c      |  33 +-
 sys/contrib/openzfs/module/zcommon/simd_stat.c     | 203 +++++++++
 .../openzfs/module/zcommon/zfeature_common.c       |  27 +-
 sys/contrib/openzfs/module/zcommon/zfs_prop.c      |  30 +-
 sys/contrib/openzfs/module/zcommon/zfs_valstr.c    |   2 +
 sys/contrib/openzfs/module/zcommon/zpool_prop.c    |   5 +-
 sys/contrib/openzfs/module/zfs/abd.c               |  94 ++--
 sys/contrib/openzfs/module/zfs/arc.c               |  37 +-
 sys/contrib/openzfs/module/zfs/dataset_kstats.c    |   6 +-
 sys/contrib/openzfs/module/zfs/dbuf.c              | 317 ++++++++++----
 sys/contrib/openzfs/module/zfs/ddt.c               |   8 -
 sys/contrib/openzfs/module/zfs/ddt_zap.c           |  14 +-
 sys/contrib/openzfs/module/zfs/dmu.c               | 154 +++++--
 sys/contrib/openzfs/module/zfs/dmu_direct.c        | 395 +++++++++++++++++
 sys/contrib/openzfs/module/zfs/dmu_objset.c        |  78 ++--
 sys/contrib/openzfs/module/zfs/dmu_recv.c          |  42 +-
 sys/contrib/openzfs/module/zfs/dmu_redact.c        |   8 +-
 sys/contrib/openzfs/module/zfs/dmu_send.c          |  17 +-
 sys/contrib/openzfs/module/zfs/dmu_tx.c            |   4 +-
 sys/contrib/openzfs/module/zfs/dsl_bookmark.c      |   8 +-
 sys/contrib/openzfs/module/zfs/dsl_crypt.c         |   6 +-
 sys/contrib/openzfs/module/zfs/dsl_dataset.c       |  21 +-
 sys/contrib/openzfs/module/zfs/dsl_deadlist.c      |  38 +-
 sys/contrib/openzfs/module/zfs/dsl_deleg.c         |  36 +-
 sys/contrib/openzfs/module/zfs/dsl_destroy.c       |   4 +-
 sys/contrib/openzfs/module/zfs/dsl_dir.c           |   7 +-
 sys/contrib/openzfs/module/zfs/dsl_pool.c          |  12 +-
 sys/contrib/openzfs/module/zfs/dsl_prop.c          |  41 +-
 sys/contrib/openzfs/module/zfs/dsl_scan.c          |  79 ++--
 sys/contrib/openzfs/module/zfs/dsl_userhold.c      |   4 +-
 sys/contrib/openzfs/module/zfs/metaslab.c          |   2 +-
 sys/contrib/openzfs/module/zfs/sa.c                |  34 +-
 sys/contrib/openzfs/module/zfs/spa.c               |  72 ++--
 sys/contrib/openzfs/module/zfs/spa_errlog.c        |  84 ++--
 sys/contrib/openzfs/module/zfs/spa_log_spacemap.c  |   9 +-
 sys/contrib/openzfs/module/zfs/spa_misc.c          |   2 +
 sys/contrib/openzfs/module/zfs/spa_stats.c         |  46 ++
 sys/contrib/openzfs/module/zfs/vdev.c              |  89 +++-
 sys/contrib/openzfs/module/zfs/vdev_label.c        |   4 +
 sys/contrib/openzfs/module/zfs/zap.c               |  30 +-
 sys/contrib/openzfs/module/zfs/zap_micro.c         | 191 ++++++++-
 sys/contrib/openzfs/module/zfs/zcp_iter.c          |  29 +-
 sys/contrib/openzfs/module/zfs/zfeature.c          |   4 +-
 sys/contrib/openzfs/module/zfs/zfs_fm.c            |   2 +
 sys/contrib/openzfs/module/zfs/zfs_ioctl.c         |  36 +-
 sys/contrib/openzfs/module/zfs/zfs_log.c           |  94 ++--
 sys/contrib/openzfs/module/zfs/zfs_quota.c         |  12 +-
 sys/contrib/openzfs/module/zfs/zfs_replay.c        | 143 ++++---
 sys/contrib/openzfs/module/zfs/zfs_vnops.c         | 294 ++++++++++++-
 sys/contrib/openzfs/module/zfs/zfs_znode.c         | 401 +++++++++++++++++
 sys/contrib/openzfs/module/zfs/zio.c               | 149 ++++++-
 sys/contrib/openzfs/module/zfs/zio_compress.c      |  14 +-
 sys/contrib/openzfs/module/zfs/zvol.c              |   4 +-
 sys/contrib/openzfs/scripts/Makefile.am            |   1 -
 sys/contrib/openzfs/scripts/enum-extract.pl        |  58 ---
 sys/contrib/openzfs/scripts/zfs-tests.sh           |  73 +++-
 sys/contrib/openzfs/tests/runfiles/common.run      |  10 +-
 sys/contrib/openzfs/tests/runfiles/freebsd.run     |   4 +
 sys/contrib/openzfs/tests/runfiles/linux.run       |  15 +-
 .../tests/test-runner/bin/test-runner.py.in        |  12 +
 .../openzfs/tests/test-runner/bin/zts-report.py.in |  61 +--
 sys/contrib/openzfs/tests/zfs-tests/cmd/.gitignore |   1 +
 .../openzfs/tests/zfs-tests/cmd/Makefile.am        |   2 +
 .../tests/zfs-tests/cmd/manipulate_user_buffer.c   | 272 ++++++++++++
 .../openzfs/tests/zfs-tests/cmd/mmap_sync.c        |   2 +-
 .../openzfs/tests/zfs-tests/cmd/stride_dd.c        | 237 ++++++++---
 .../openzfs/tests/zfs-tests/include/commands.cfg   |   8 +-
 .../openzfs/tests/zfs-tests/include/libtest.shlib  |  39 +-
 .../tests/zfs-tests/include/properties.shlib       |   2 +-
 .../openzfs/tests/zfs-tests/include/tunables.cfg   |   3 +
 .../openzfs/tests/zfs-tests/tests/Makefile.am      |  34 ++
 .../tests/functional/bclone/bclone_common.kshlib   |   4 +-
 .../functional/bclone/bclone_corner_cases.kshlib   |   6 +-
 .../functional/block_cloning/block_cloning.kshlib  |   4 +-
 .../block_cloning_cross_enc_dataset.ksh            |   8 +-
 .../tests/functional/cache/cache_012_pos.ksh       |   2 +-
 .../tests/functional/cli_root/zdb/zdb_backup.ksh   |   4 +-
 .../zfs_receive_compressed_corrective.ksh          |   4 +-
 .../zfs_receive/zfs_receive_corrective.ksh         |   6 +-
 .../zfs_receive/zfs_receive_from_encrypted.ksh     |   6 +-
 .../cli_root/zfs_receive/zfs_receive_from_zstd.ksh |   4 +-
 .../zfs_receive_large_block_corrective.ksh         |   4 +-
 .../cli_root/zfs_receive/zfs_receive_raw.ksh       |   6 +-
 .../zfs_receive/zfs_receive_raw_incremental.ksh    |   4 +-
 .../cli_root/zpool_create/zpool_create.shlib       |   5 +-
 .../zpool_create/zpool_create_features_005_pos.ksh |   2 +-
 .../functional/cli_root/zpool_get/zpool_get.cfg    |   2 +
 .../import_cachefile_shared_device.ksh             |   2 +-
 .../zpool_import/import_devices_missing.ksh        |   8 +-
 .../zpool_import/import_rewind_config_changed.ksh  |   4 +-
 .../zpool_import/import_rewind_device_replaced.ksh |   6 +-
 .../cli_root/zpool_import/zpool_import.cfg         |   4 +-
 .../cli_root/zpool_import/zpool_import.kshlib      |  34 +-
 ...ort_hostid_changed_cachefile_unclean_export.ksh |  10 +-
 .../zpool_import_hostid_changed_unclean_export.ksh |   9 +-
 .../functional/cli_root/zpool_reguid/Makefile.am   |   6 -
 .../cli_root/zpool_reguid/zpool_reguid_001_pos.ksh |   4 +-
 .../cli_root/zpool_reguid/zpool_reguid_002_neg.ksh |   2 +-
 .../cli_root/zpool_reopen/zpool_reopen_003_pos.ksh |   4 +-
 .../cli_root/zpool_status/zpool_status_008_pos.ksh |   6 +-
 .../compression/l2arc_compressed_arc.ksh           |   2 +-
 .../functional/compression/l2arc_encrypted.ksh     |   2 +-
 .../l2arc_encrypted_no_compressed_arc.ksh          |   2 +-
 .../tests/functional/cp_files/cp_files_002_pos.ksh |   4 +-
 .../tests/functional/deadman/deadman_sync.ksh      |   8 +-
 .../zfs-tests/tests/functional/direct/cleanup.ksh  |  37 ++
 .../zfs-tests/tests/functional/direct/dio.cfg      |  26 ++
 .../zfs-tests/tests/functional/direct/dio.kshlib   | 331 ++++++++++++++
 .../tests/functional/direct/dio_aligned_block.ksh  | 115 +++++
 .../tests/functional/direct/dio_async_always.ksh   |  68 +++
 .../functional/direct/dio_async_fio_ioengines.ksh  | 106 +++++
 .../tests/functional/direct/dio_compression.ksh    |  65 +++
 .../tests/functional/direct/dio_dedup.ksh          |  63 +++
 .../tests/functional/direct/dio_encryption.ksh     |  62 +++
 .../tests/functional/direct/dio_grow_block.ksh     |  86 ++++
 .../tests/functional/direct/dio_max_recordsize.ksh |  64 +++
 .../tests/functional/direct/dio_mixed.ksh          | 107 +++++
 .../zfs-tests/tests/functional/direct/dio_mmap.ksh |  92 ++++
 .../tests/functional/direct/dio_overwrites.ksh     |  70 +++
 .../tests/functional/direct/dio_property.ksh       | 127 ++++++
 .../tests/functional/direct/dio_random.ksh         |  82 ++++
 .../tests/functional/direct/dio_recordsize.ksh     |  68 +++
 .../functional/direct/dio_unaligned_block.ksh      |  78 ++++
 .../functional/direct/dio_unaligned_filesize.ksh   |  91 ++++
 .../functional/direct/dio_write_stable_pages.ksh   | 103 +++++
 .../tests/functional/direct/dio_write_verify.ksh   | 196 +++++++++
 .../zfs-tests/tests/functional/direct/setup.ksh    |  37 ++
 .../functional/events/zed_diagnose_multiple.ksh    | 168 ++++++++
 .../functional/events/zed_slow_io_many_vdevs.ksh   |   4 +-
 .../tests/functional/fault/fault_limits.ksh        |  96 +++++
 .../functional/fault/suspend_resume_single.ksh     |   4 +-
 .../tests/functional/history/history_003_pos.ksh   |   6 +-
 .../tests/zfs-tests/tests/functional/io/setup.ksh  |   2 +-
 .../zfs-tests/tests/functional/l2arc/l2arc.cfg     |   2 +-
 .../tests/functional/longname/cleanup.ksh          |  34 ++
 .../tests/functional/longname/longname_001_pos.ksh | 132 ++++++
 .../tests/functional/longname/longname_002_pos.ksh | 115 +++++
 .../tests/functional/longname/longname_003_pos.ksh | 113 +++++
 .../zfs-tests/tests/functional/longname/setup.ksh  |  35 ++
 .../tests/functional/no_space/enospc_ganging.ksh   |   6 +-
 .../functional/projectquota/projectid_003_pos.ksh  |   4 +-
 .../functional/raidz/raidz_expand_001_pos.ksh      |   3 +
 .../functional/raidz/raidz_expand_002_pos.ksh      |   1 +
 .../replacement/resilver_restart_001.ksh           |  11 +-
 .../zfs-tests/tests/functional/rsend/rsend.kshlib  |  22 +-
 .../tests/functional/rsend/send-c_longname.ksh     |  98 +++++
 .../tests/functional/rsend/send-c_volume.ksh       |  12 +-
 .../functional/rsend/send-wR_encrypted_zvol.ksh    |   6 +-
 .../functional/rsend/send_encrypted_props.ksh      |  14 +-
 .../rsend/send_encrypted_truncated_files.ksh       |  12 +-
 .../tests/functional/rsend/send_hole_birth.ksh     |   2 +-
 .../tests/functional/slog/slog_replay_fs_001.ksh   |  16 +-
 .../tests/functional/slog/slog_replay_volume.ksh   |   4 +-
 .../zfs-tests/tests/functional/trim/trim_l2arc.ksh |   2 +-
 .../tests/functional/xattr/xattr_001_pos.ksh       |   2 +-
 .../tests/functional/xattr/xattr_002_neg.ksh       |   2 +-
 sys/contrib/openzfs/udev/zvol_id.c                 |   7 +-
 sys/modules/zfs/Makefile                           |   4 +-
 sys/modules/zfs/zfs_config.h                       | 474 ++-------------------
 sys/modules/zfs/zfs_gitrev.h                       |   2 +-
 tools/build/depend-cleanup.sh                      |   3 +
 444 files changed, 12924 insertions(+), 9366 deletions(-)

diff --cc cddl/lib/libzdb/Makefile
index 63248399b91c,000000000000..0eb30c55d107
mode 100644,000000..100644
--- a/cddl/lib/libzdb/Makefile
+++ b/cddl/lib/libzdb/Makefile
@@@ -1,25 -1,0 +1,26 @@@
 +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzdb
 +.PATH: ${SRCTOP}/sys/contrib/openzfs/include
 +
 +LIB=	zdb
 +PACKAGE=	zfs
 +
 +INCS = libzdb.h
 +
 +SRCS = libzdb.c 
 +
 +WARNS?=	2
 +CSTD=	c99
 +
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
++CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs
 +CFLAGS+= -I${SRCTOP}/sys
 +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
 +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzutil
 +CFLAGS+= -DHAVE_ISSETUGID -DIN_BASE
 +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
 +
 +.include <bsd.lib.mk>
diff --cc cddl/lib/libzfs_core/Makefile
index 4cd978e99a7d,000000000000..d986c45725b3
mode 100644,000000..100644
--- a/cddl/lib/libzfs_core/Makefile
+++ b/cddl/lib/libzfs_core/Makefile
@@@ -1,31 -1,0 +1,32 @@@
 +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfs_core
 +.PATH: ${SRCTOP}/sys/contrib/openzfs/include
 +.PATH: ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs
 +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/os/freebsd/zfs
 +
 +
 +LIB=	zfs_core
 +LIBADD=	nvpair spl zutil
 +PACKAGE=	zfs
 +
 +INCS=	libzfs_core.h
 +SRCS=	libzfs_core.c \
 +	os/freebsd/libzfs_core_ioctl.c \
 +	zfs_ioctl_compat.c
 +
 +WARNS?=	2
 +CSTD=	c99
 +CFLAGS+= -DIN_BASE
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzfs_core/common
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
++CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs
 +CFLAGS+= -I${SRCTOP}/sys
 +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include
 +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
 +CFLAGS+= -DHAVE_ISSETUGID
 +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
 +
 +.include <bsd.lib.mk>
diff --cc cddl/lib/libzfsbootenv/Makefile
index 5f5dbfb6f108,000000000000..15ee5bfaeaa4
mode 100644,000000..100644
--- a/cddl/lib/libzfsbootenv/Makefile
+++ b/cddl/lib/libzfsbootenv/Makefile
@@@ -1,34 -1,0 +1,35 @@@
 +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzfsbootenv
 +.PATH: ${SRCTOP}/sys/contrib/openzfs/include
 +
 +PACKAGE=	zfs
 +LIB=		zfsbootenv
 +SHLIB_MAJOR=	1
 +
 +LIBADD=		zfs
 +LIBADD+=	nvpair
 +
 +INCS=	libzfsbootenv.h
 +USER_C=	\
 +	lzbe_device.c \
 +	lzbe_util.c \
 +	lzbe_pair.c
 +
 +SRCS= $(USER_C)
 +
 +CSTD=	c99
 +CFLAGS+= -DIN_BASE
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libspl/include/os/freebsd
++CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include
 +CFLAGS+= -I${SRCTOP}/cddl/compat/opensolaris/include
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/module/icp/include
 +CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccompile.h
 +CFLAGS+= -DHAVE_ISSETUGID
 +CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
 +CFLAGS+= -I${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/zfs
 +CFLAGS.lzbe_device.c=	-Wno-cast-qual
 +CFLAGS.lzbe_util.c=	-Wno-cast-qual
 +CFLAGS.lzbe_pair.c=	-Wno-cast-qual
 +
 +.include <bsd.lib.mk>
diff --cc cddl/lib/libzpool/Makefile
index b80486484506,000000000000..4c8285eedb2d
mode 100644,000000..100644
--- a/cddl/lib/libzpool/Makefile
+++ b/cddl/lib/libzpool/Makefile
@@@ -1,341 -1,0 +1,345 @@@
 +ZFSTOP=	${SRCTOP}/sys/contrib/openzfs
 +
 +.PATH: ${ZFSTOP}/lib/libzpool
 +
 +# ZFS_COMMON_SRCS
 +.PATH: ${ZFSTOP}/module/zfs
 +.PATH: ${ZFSTOP}/module/zcommon
 +.PATH: ${ZFSTOP}/module/unicode
 +# LUA_SRCS
 +.PATH: ${ZFSTOP}/module/lua
 +# ZSTD_SRCS
 +.PATH: ${ZFSTOP}/module/zstd
 +.PATH: ${ZFSTOP}/module/zstd/lib/common
 +.PATH: ${ZFSTOP}/module/zstd/lib/compress
 +.PATH: ${ZFSTOP}/module/zstd/lib/decompress
 +
- .PATH: ${ZFSTOP}/module/os/linux/zfs
- 
 +.if exists(${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}/opensolaris_atomic.S)
 +.PATH: ${SRCTOP}/sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
 +ATOMIC_SRCS=	opensolaris_atomic.S
 +ACFLAGS+=	-Wa,--noexecstack
 +.else
 +.PATH: ${SRCTOP}/sys/cddl/compat/opensolaris/kern
 +ATOMIC_SRCS=	opensolaris_atomic.c
 +.endif
 +
 +.if ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpcspe"
 +# Don't waste GOT entries on small data.
 +PICFLAG=	-fPIC
 +.endif
 +
 +PACKAGE=	zfs
 +LIB=		zpool
 +
 +USER_C = \
- 	abd_os.c \
++	arc_os.c \
 +	kernel.c \
 +	taskq.c \
- 	util.c
++	util.c \
++	zfs_debug.c
++
++.PATH: ${ZFSTOP}/module/os/linux/zfs
 +
 +KERNEL_C = \
++	simd_stat.c \
 +	zfeature_common.c \
 +	zfs_comutil.c \
 +	zfs_deleg.c \
 +	zfs_fletcher.c \
 +	zfs_fletcher_superscalar.c \
 +	zfs_fletcher_superscalar4.c \
 +	zfs_namecheck.c \
 +	zfs_prop.c \
 +	zfs_zstd.c \
 +	zpool_prop.c \
 +	zprop_common.c \
 +	abd.c \
++	abd_os.c \
 +	aggsum.c \
 +	arc.c \
- 	arc_os.c \
 +        blake3_zfs.c \
 +	blkptr.c \
 +	bplist.c \
 +	bpobj.c \
 +	bptree.c \
 +	bqueue.c \
 +	btree.c \
 +	brt.c \
 +	cityhash.c \
 +	dbuf.c \
 +	dbuf_stats.c \
 +	ddt.c \
 +	ddt_log.c \
 +	ddt_stats.c \
 +	ddt_zap.c \
 +	dmu.c \
 +	dmu_diff.c \
++	dmu_direct.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_bookmark.c \
 +	dsl_dataset.c \
 +	dsl_deadlist.c \
 +	dsl_deleg.c \
 +	dsl_dir.c \
 +	dsl_crypt.c \
 +	dsl_pool.c \
 +	dsl_prop.c \
 +	dsl_scan.c \
 +	dsl_synctask.c \
 +	dsl_destroy.c \
 +	dsl_userhold.c \
 +	edonr_zfs.c \
 +	entropy_common.c \
 +	error_private.c \
 +	fm.c \
 +	fse_compress.c \
 +	fse_decompress.c \
 +	gzip.c \
 +	hist.c \
 +	hkdf.c \
 +	huf_compress.c \
 +	huf_decompress.c \
 +	lzjb.c \
 +	lz4.c \
 +	lz4_zfs.c \
 +	metaslab.c \
 +	mmp.c \
 +	multilist.c \
 +	objlist.c \
 +	pathname.c \
 +	pool.c \
 +	range_tree.c \
 +	refcount.c \
 +	rrwlock.c \
 +	sa.c \
 +	sha2_zfs.c \
 +	skein_zfs.c \
 +	spa.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 \
 +	trace.c \
 +	uberblock.c \
 +	unique.c \
 +	vdev.c \
 +	vdev_draid.c \
 +	vdev_draid_rand.c \
 +	vdev_file.c \
 +	vdev_indirect_births.c \
 +	vdev_indirect.c \
 +	vdev_indirect_mapping.c \
 +	vdev_initialize.c \
 +	vdev_label.c \
 +	vdev_label_os.c \
 +	vdev_mirror.c \
 +	vdev_missing.c \
 +	vdev_queue.c \
 +	vdev_raidz.c \
 +	vdev_raidz_math_aarch64_neon.c \
 +	vdev_raidz_math_aarch64_neonx2.c \
 +	vdev_raidz_math_avx2.c \
 +	vdev_raidz_math_avx512bw.c \
 +	vdev_raidz_math_avx512f.c \
 +	vdev_raidz_math.c \
 +	vdev_raidz_math_scalar.c \
 +	vdev_rebuild.c \
 +	vdev_removal.c \
 +	vdev_root.c \
 +	vdev_trim.c \
 +	xxhash.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_chksum.c \
- 	zfs_debug.c \
 +	zfs_fm.c \
 +	zfs_fuid.c \
 +	zfs_sa.c \
 +	zfs_znode.c \
 +	zfs_racct.c \
 +	zfs_ratelimit.c \
 +	zfs_rlock.c \
 +	zil.c \
 +	zio.c \
 +	zio_checksum.c \
 +	zio_compress.c \
 +	zio_crypt.c \
 +	zio_inject.c \
 +	zle.c \
 +	zrlock.c \
 +	zstd_common.c \
 +	zstd_compress.c \
 +	zstd_compress_literals.c \
 +	zstd_compress_sequences.c \
 +	zstd_compress_superblock.c \
 +	zstd_ddict.c \
 +	zstd_decompress.c \
 +	zstd_decompress_block.c \
 +	zstd_double_fast.c \
 +	zstd_fast.c \
 +	zstd_lazy.c \
 +	zstd_ldm.c \
 +	zstd_opt.c \
 +	zthr.c
 +
 +ARCH_C =
 +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386"
 +ARCH_C += 	vdev_raidz_math_sse2.c \
 +		vdev_raidz_math_ssse3.c \
 +		zfs_fletcher_intel.c \
 +		zfs_fletcher_sse.c 
 +CFLAGS +=  -DHAVE_SSE2 	-DHAVE_SSE3
 +.endif
 +.if ${MACHINE_ARCH} == "amd64"
 +ARCH_C +=	zfs_fletcher_avx512.c
 +CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_AVX512F \
 +	-DHAVE_AVX512BW
 +.endif
 +.if ${MACHINE_CPUARCH} == "aarch64"
 +ARCH_C +=	zfs_fletcher_aarch64_neon.c
 +.endif
 +
 +LUA_C = \
 +	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
 +
 +UNICODE_C = u8_textprep.c uconv.c
 +
- SRCS=		${USER_C} ${KERNEL_C} ${LUA_C} ${UNICODE_C} ${ARCH_C}
++SRCS+=		${USER_C} ${KERNEL_C} ${LUA_C} ${UNICODE_C} ${ARCH_C}
++
 +
 +WARNS?=		2
 +CFLAGS+= \
 +	-DIN_BASE \
 +	-I${ZFSTOP}/include \
 +	-I${ZFSTOP}/lib/libspl/include \
 +	-I${ZFSTOP}/lib/libspl/include/os/freebsd \
 +	-I${SRCTOP}/sys/contrib/openzfs/lib/libzpool/include \
 +	-I${SRCTOP}/sys \
 +	-I${ZFSTOP}/include/os/freebsd/zfs \
 +	-I${SRCTOP}/cddl/compat/opensolaris/include \
 +	-I${ZFSTOP}/module/icp/include \
++	-I${SRCTOP}/compat/linuxkpi/common/include/linux \
 +	-include ${ZFSTOP}/include/os/freebsd/spl/sys/ccompile.h \
 +	-DHAVE_ISSETUGID \
 +	-include ${SRCTOP}/sys/modules/zfs/zfs_config.h \
 +	-I${SRCTOP}/sys/modules/zfs \
 +	-I${ZFSTOP}/include/os/freebsd/zfs \
 +	-DLIB_ZPOOL_BUILD -DZFS_DEBUG \
 +
 +# XXX: pthread doesn't have mutex_owned() equivalent, so we need to look
 +#      into libthr private structures. That's sooo evil, but it's only for
 +#      ZFS debugging tools needs.
 +CFLAGS+=	-DWANTS_MUTEX_OWNED
 +CFLAGS+=	-I${SRCTOP}/lib/libpthread/thread
 +CFLAGS+=	-I${SRCTOP}/lib/libpthread/sys
 +CFLAGS+=	-I${SRCTOP}/lib/libthr/arch/${MACHINE_CPUARCH}/include
 +CFLAGS.gcc+=	-fms-extensions
 +
 +LIBADD=		md pthread z spl icp nvpair avl umem
 +
 +# atomic.S doesn't like profiling.
 +MK_PROFILE=	no
 +
 +CSTD=	c99
 +
 +# Since there are many asserts in this library, it makes no sense to compile
 +# it without debugging.
 +
 +CFLAGS+=	-g -DDEBUG=1
 +
 +CFLAGS.gcc+=	-Wno-pointer-to-int-cast
 +
 +# Pointer values are used as debugging "tags" to mark reference count
 +# ownerships and in some cases the tag reference is dropped after an
 +# object is freed.
 +CFLAGS.dbuf.c=			${NO_WUSE_AFTER_FREE}
 +CFLAGS.entropy_common.c=	-fno-tree-vectorize
 +CFLAGS.entropy_common.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.error_private.c=		-fno-tree-vectorize
 +CFLAGS.error_private.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.fse_compress.c=		-fno-tree-vectorize
 +CFLAGS.fse_compress.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.fse_decompress.c=	-fno-tree-vectorize
 +CFLAGS.fse_decompress.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.hist.c=			-fno-tree-vectorize
 +CFLAGS.hist.c+=			${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.huf_compress.c=		-fno-tree-vectorize
 +CFLAGS.huf_compress.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.huf_decompress.c=	-fno-tree-vectorize
 +CFLAGS.huf_decompress.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.pool.c=			-fno-tree-vectorize
 +CFLAGS.pool.c+=			${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.xxhash.c=		-fno-tree-vectorize
 +CFLAGS.xxhash.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_compress.c=		-fno-tree-vectorize
 +CFLAGS.zstd_compress.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_compress_literals.c=	-fno-tree-vectorize
 +CFLAGS.zstd_compress_literals.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_compress_sequences.c=	-fno-tree-vectorize
 +CFLAGS.zstd_compress_sequences.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_compress_superblock.c=	-fno-tree-vectorize
 +CFLAGS.zstd_compress_superblock.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_double_fast.c=	-fno-tree-vectorize
 +CFLAGS.zstd_double_fast.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_fast.c=		-fno-tree-vectorize
 +CFLAGS.zstd_fast.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_lazy.c=		-fno-tree-vectorize
 +CFLAGS.zstd_lazy.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_ldm.c=		-fno-tree-vectorize
 +CFLAGS.zstd_ldm.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_opt.c=		-fno-tree-vectorize
 +CFLAGS.zstd_opt.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_ddict.c=		-fno-tree-vectorize
 +CFLAGS.zstd_ddict.c+=		${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_decompress.c=	-fno-tree-vectorize
 +CFLAGS.zstd_decompress.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +CFLAGS.zstd_decompress_block.c=	-fno-tree-vectorize
 +CFLAGS.zstd_decompress_block.c+=	${NO_WBITWISE_INSTEAD_OF_LOGICAL}
 +
 +.include <bsd.lib.mk>
diff --cc cddl/lib/libzutil/Makefile
index 4d9794c32dda,000000000000..d1a943b25005
mode 100644,000000..100644
--- a/cddl/lib/libzutil/Makefile
+++ b/cddl/lib/libzutil/Makefile
@@@ -1,39 -1,0 +1,40 @@@
 +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzutil
 +.PATH: ${SRCTOP}/sys/contrib/openzfs/lib/libzutil/os/freebsd
 +.PATH: ${SRCTOP}/sys/contrib/openzfs/module/os/freebsd/zfs
 +
 +LIB=	zutil
 +LIBADD=	avl geom m tpool
 +PACKAGE=	zfs
 +
 +INCS = zutil_import.h
 +
 +SRCS = \
 +        zutil_device_path.c \
 +        zutil_import.c \
 +        zutil_import.h \
 +        zutil_nicenum.c \
*** 8197 LINES SKIPPED ***