git: d0b3ecdc2749 - main - zfs: merge openzfs/zfs@37af89948

From: Martin Matuska <mm_at_FreeBSD.org>
Date: Sat, 27 Jun 2026 08:53:05 UTC
The branch main has been updated by mm:

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

commit d0b3ecdc274930e190ea233b6b69ff03782eaf8d
Merge: 8e61d8707f8a 37af89948865
Author:     Martin Matuska <mm@FreeBSD.org>
AuthorDate: 2026-06-27 06:15:42 +0000
Commit:     Martin Matuska <mm@FreeBSD.org>
CommitDate: 2026-06-27 08:51:33 +0000

    zfs: merge openzfs/zfs@37af89948
    
    Notable upstream pull request merges:
     #18509 f16b3744d zstream: refactor common functions
     #18573 -multiple Persist z_seq across znode eviction
     s18611 eb0c674c2 zfs_ioctl: fix EBUSY race between quota queries and mount
     #18637 77e64d86e Fix self-deadlock when setting the "allocating"/"path"
                      vdev property
     #18645 e3082b923 freebsd: set mnt_time on the rootfs at mountroot time
     #18652 50d012b2a zbookmark_compare: handle "marker" bookmarks with negative
                      levels
     #18664 520eeeaa6 Improve performance of "zpool offline" for log devices
     #18668 6b8f79877 Avoid more abd_t allocations in RAIDZ/dRAID
     #18669 99ab859c3 Optimize metaslab_set_selected_txg()
     #18673 97b9ba7a9 delegate: add 'send:encrypted' permission
     #18687 2ea519c2a Avoid lookup overhead for nonexistent xattr directories
     #18688 87593ea2b Fix handling of _PC_HAS_HIDDENSYSTEM for FreeBSD
     #18693 0483a8e0c Clean up embedded slog metaslab across txgs
     #18695 41311c665 RAIDZ: Optimize single data column writes
     #18706 37af89948 ddt_log: Fix refcount tagging for begin/commit
    
    Obtained from:  OpenZFS
    OpenZFS commit: 37af899488652c55c456d3f160fb8b295db2ec70

 cddl/usr.bin/zstream/Makefile                      |    7 +-
 sys/contrib/openzfs/.github/workflows/README.md    |    2 +-
 .../.github/workflows/scripts/qemu-2-start.sh      |    4 +-
 .../.github/workflows/scripts/qemu-4-build-vm.sh   |    7 +-
 .../openzfs/.github/workflows/unit-tests.yml       |   29 +
 sys/contrib/openzfs/.github/workflows/zfs-qemu.yml |    8 +-
 sys/contrib/openzfs/META                           |    2 +-
 sys/contrib/openzfs/README.md                      |    2 +-
 sys/contrib/openzfs/cmd/zfs/zfs_main.c             |   13 +-
 sys/contrib/openzfs/cmd/zstream/Makefile.am        |   14 +-
 sys/contrib/openzfs/cmd/zstream/zstream.c          |   46 +-
 sys/contrib/openzfs/cmd/zstream/zstream_byteswap.c |  198 ++++
 sys/contrib/openzfs/cmd/zstream/zstream_byteswap.h |   55 +
 sys/contrib/openzfs/cmd/zstream/zstream_chain.c    |  155 +++
 sys/contrib/openzfs/cmd/zstream/zstream_chain.h    |  181 ++++
 .../openzfs/cmd/zstream/zstream_decompress.c       |  392 +++----
 .../openzfs/cmd/zstream/zstream_drop_record.c      |  325 ++----
 sys/contrib/openzfs/cmd/zstream/zstream_dump.c     | 1072 ++++++++------------
 .../openzfs/cmd/zstream/zstream_fletcher4.c        |  180 ++++
 .../openzfs/cmd/zstream/zstream_fletcher4.h        |   78 ++
 sys/contrib/openzfs/cmd/zstream/zstream_io.c       |  462 +++++++++
 sys/contrib/openzfs/cmd/zstream/zstream_io.h       |   74 ++
 sys/contrib/openzfs/cmd/zstream/zstream_modules.h  |   62 ++
 .../openzfs/cmd/zstream/zstream_recompress.c       |  504 ++++-----
 .../openzfs/cmd/zstream/zstream_recompress.h       |   40 +
 sys/contrib/openzfs/cmd/zstream/zstream_redup.c    |  433 +++-----
 sys/contrib/openzfs/cmd/zstream/zstream_token.c    |   13 +-
 sys/contrib/openzfs/cmd/zstream/zstream_util.c     |  169 ++-
 sys/contrib/openzfs/cmd/zstream/zstream_util.h     |   54 +-
 sys/contrib/openzfs/cmd/zstream/zstream_validate.c |  129 +++
 sys/contrib/openzfs/cmd/zstream/zstream_validate.h |   36 +
 sys/contrib/openzfs/contrib/initramfs/hooks/zfs.in |    2 +-
 .../include/os/freebsd/zfs/sys/zfs_vfsops_os.h     |    2 +
 .../openzfs/include/os/linux/zfs/sys/trace_acl.h   |    4 +-
 .../include/os/linux/zfs/sys/zfs_vfsops_os.h       |    2 +
 sys/contrib/openzfs/include/sys/abd.h              |    3 +
 sys/contrib/openzfs/include/sys/dsl_deleg.h        |    1 +
 sys/contrib/openzfs/include/sys/vdev.h             |    4 +-
 sys/contrib/openzfs/include/sys/zap.h              |    2 +
 sys/contrib/openzfs/include/sys/zfs_sa.h           |    1 +
 sys/contrib/openzfs/include/sys/zfs_znode.h        |   28 +-
 sys/contrib/openzfs/include/zfs_crrd.h             |    7 +-
 sys/contrib/openzfs/include/zfs_deleg.h            |    1 +
 sys/contrib/openzfs/man/man1/ztest.1               |    2 +-
 sys/contrib/openzfs/man/man4/zfs.4                 |    4 +
 sys/contrib/openzfs/man/man8/zfs-allow.8           |    4 +-
 .../openzfs/module/os/freebsd/zfs/sysctl_os.c      |    9 -
 .../openzfs/module/os/freebsd/zfs/zfs_acl.c        |    4 +-
 .../openzfs/module/os/freebsd/zfs/zfs_dir.c        |   51 +-
 .../openzfs/module/os/freebsd/zfs/zfs_vfsops.c     |   39 +-
 .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c   |   53 +-
 .../openzfs/module/os/freebsd/zfs/zfs_znode_os.c   |   36 +-
 sys/contrib/openzfs/module/os/linux/zfs/zfs_acl.c  |    4 +-
 .../openzfs/module/os/linux/zfs/zfs_ctldir.c       |    1 +
 sys/contrib/openzfs/module/os/linux/zfs/zfs_dir.c  |   40 +-
 .../openzfs/module/os/linux/zfs/zfs_vfsops.c       |   31 +-
 .../openzfs/module/os/linux/zfs/zfs_vnops_os.c     |   74 +-
 .../openzfs/module/os/linux/zfs/zfs_znode_os.c     |   41 +-
 sys/contrib/openzfs/module/os/linux/zfs/zpl_file.c |   33 +-
 .../openzfs/module/os/linux/zfs/zpl_inode.c        |   10 +-
 .../openzfs/module/os/linux/zfs/zpl_xattr.c        |   10 +
 sys/contrib/openzfs/module/zcommon/zfs_deleg.c     |    1 +
 sys/contrib/openzfs/module/zfs/abd.c               |   45 +-
 sys/contrib/openzfs/module/zfs/ddt_log.c           |    4 +-
 sys/contrib/openzfs/module/zfs/metaslab.c          |    3 +
 sys/contrib/openzfs/module/zfs/spa.c               |    4 +
 sys/contrib/openzfs/module/zfs/vdev.c              |  102 +-
 sys/contrib/openzfs/module/zfs/vdev_draid.c        |   10 +-
 sys/contrib/openzfs/module/zfs/vdev_raidz.c        |   55 +-
 sys/contrib/openzfs/module/zfs/zap.c               |    2 +-
 sys/contrib/openzfs/module/zfs/zfs_crrd.c          |   22 +-
 sys/contrib/openzfs/module/zfs/zfs_ioctl.c         |  134 ++-
 sys/contrib/openzfs/module/zfs/zfs_sa.c            |    5 +-
 sys/contrib/openzfs/module/zfs/zfs_vnops.c         |   39 +-
 sys/contrib/openzfs/module/zfs/zio.c               |   61 ++
 sys/contrib/openzfs/tests/runfiles/common.run      |   40 +-
 sys/contrib/openzfs/tests/runfiles/linux.run       |    2 +-
 sys/contrib/openzfs/tests/runfiles/sanity.run      |    7 +-
 sys/contrib/openzfs/tests/unit/.gitignore          |    1 +
 sys/contrib/openzfs/tests/unit/Makefile.am         |   16 +-
 sys/contrib/openzfs/tests/unit/test_namecheck.c    |  314 ++++++
 sys/contrib/openzfs/tests/unit/test_zap.c          |  512 +++++++++-
 .../openzfs/tests/zfs-tests/tests/Makefile.am      |   72 +-
 .../cli_root/zfs_send_delegation/zfs_send_test.ksh |  111 --
 .../cli_root/zpool_set/vdev_set_allocating.ksh     |   80 ++
 .../cli_root/zpool_set/vdev_set_path.ksh           |   90 ++
 .../cli_user/zfs_send_delegation_user/setup.ksh    |   50 -
 .../zfs_send_delegation_user/zfs_send_usertest.ksh |  150 ---
 .../functional/delegate/delegate_common.kshlib     |   52 +-
 .../tests/functional/delegate/zfs_allow_send.ksh   |   57 ++
 .../tests/functional/events/events_common.kshlib   |    2 +-
 .../fallocate/fallocate_extend_timestamps.ksh      |   77 ++
 .../projectquota/projectspace_006_pos.ksh          |   97 ++
 .../functional/userquota/groupspace_005_pos.ksh    |  100 ++
 .../functional/userquota/userspace_005_pos.ksh     |  100 ++
 .../tests/functional/zstream/beadtbn-new.dump.bz2  |  Bin 0 -> 1286 bytes
 .../tests/functional/zstream/beadtbn-old.dump.bz2  |  Bin 0 -> 1222 bytes
 .../tests/functional/zstream/beadtbx-new.dump.bz2  |  Bin 0 -> 1289 bytes
 .../tests/functional/zstream/beadtbx-old.dump.bz2  |  Bin 0 -> 1224 bytes
 .../tests/functional/zstream/beadtin-new.dump.bz2  |  Bin 0 -> 3230 bytes
 .../tests/functional/zstream/beadtin-old.dump.bz2  |  Bin 0 -> 3178 bytes
 .../tests/functional/zstream/beadtix-new.dump.bz2  |  Bin 0 -> 3221 bytes
 .../tests/functional/zstream/beadtix-old.dump.bz2  |  Bin 0 -> 3180 bytes
 .../tests/functional/zstream/belp-new.dump.bz2     |  Bin 0 -> 1112 bytes
 .../tests/functional/zstream/belp-old.dump.bz2     |  Bin 0 -> 1101 bytes
 .../big-endian-all-drr-types-base-NATIVE.zsend.bz2 |  Bin 0 -> 7382 bytes
 .../big-endian-all-drr-types-base-XDR.zsend.bz2    |  Bin 0 -> 7466 bytes
 .../big-endian-all-drr-types-incr-NATIVE.zsend.bz2 |  Bin 0 -> 40989 bytes
 .../big-endian-all-drr-types-incr-XDR.zsend.bz2    |  Bin 0 -> 41155 bytes
 .../zstream/big-endian-long-payloads.zsend.bz2     |  Bin 0 -> 37023 bytes
 .../zfs_send_delegation => zstream}/cleanup.ksh    |   20 +-
 .../tests/functional/zstream/d-new.dump.bz2        |  Bin 0 -> 1130 bytes
 .../tests/functional/zstream/dc-new.dump.bz2       |  Bin 0 -> 2175 bytes
 .../functional/zstream/decompress-crypt.zsend.bz2  |  Bin 0 -> 28946 bytes
 .../tests/functional/zstream/decompress.zsend.bz2  |  Bin 0 -> 5970 bytes
 .../tests/functional/zstream/leadtbn-new.dump.bz2  |  Bin 0 -> 1295 bytes
 .../tests/functional/zstream/leadtbn-old.dump.bz2  |  Bin 0 -> 1224 bytes
 .../tests/functional/zstream/leadtbx-new.dump.bz2  |  Bin 0 -> 1287 bytes
 .../tests/functional/zstream/leadtbx-old.dump.bz2  |  Bin 0 -> 1221 bytes
 .../tests/functional/zstream/leadtin-new.dump.bz2  |  Bin 0 -> 3308 bytes
 .../tests/functional/zstream/leadtin-old.dump.bz2  |  Bin 0 -> 3241 bytes
 .../tests/functional/zstream/leadtix-new.dump.bz2  |  Bin 0 -> 3277 bytes
 .../tests/functional/zstream/leadtix-old.dump.bz2  |  Bin 0 -> 3241 bytes
 .../tests/functional/zstream/lelp-new.dump.bz2     |  Bin 0 -> 1116 bytes
 .../tests/functional/zstream/lelp-old.dump.bz2     |  Bin 0 -> 1097 bytes
 ...ttle-endian-all-drr-types-base-NATIVE.zsend.bz2 |  Bin 0 -> 7491 bytes
 .../little-endian-all-drr-types-base-XDR.zsend.bz2 |  Bin 0 -> 6979 bytes
 ...ttle-endian-all-drr-types-incr-NATIVE.zsend.bz2 |  Bin 0 -> 43463 bytes
 .../little-endian-all-drr-types-incr-XDR.zsend.bz2 |  Bin 0 -> 40759 bytes
 .../zstream/little-endian-long-payloads.zsend.bz2  |  Bin 0 -> 46633 bytes
 .../cleanup.ksh => zstream/setup.ksh}              |   20 +-
 .../zstream/test-stream-creation-scripts/README    |   19 +
 .../test-stream-creation-scripts/add-xattrs.py     |  112 ++
 .../gen-lorem-files.py                             |  109 ++
 .../make-all-records-streams.sh                    |   67 ++
 .../make-decompression-streams.sh                  |   49 +
 .../make-dump-files.py                             |   97 ++
 .../make-long-payloads.sh                          |   48 +
 .../test-stream-creation-scripts/make-venv.sh      |   27 +
 .../setup.ksh => zstream/zstream.cfg}              |   29 +-
 .../tests/functional/zstream/zstream.kshlib        |   90 ++
 .../zstream/zstream_checksum_001_pos.ksh           |   64 ++
 .../zstream/zstream_decompress_001_pos.ksh         |   98 ++
 .../zstream/zstream_decompress_002_pos.ksh         |   57 ++
 .../zstream/zstream_decompress_003_neg.ksh         |   59 ++
 .../zstream/zstream_decompress_004_pos.ksh         |   55 +
 .../zstream/zstream_decompress_005_pos.ksh         |  115 +++
 .../zstream/zstream_decompress_006_neg.ksh         |   61 ++
 .../zstream_drop_record_001_pos.ksh}               |    9 +-
 .../zstream_dump_001_pos.ksh}                      |   13 +-
 .../functional/zstream/zstream_dump_002_pos.ksh    |   84 ++
 .../functional/zstream/zstream_dump_003_pos.ksh    |   92 ++
 .../functional/zstream/zstream_dump_004_neg.ksh    |   88 ++
 .../zstream_recompress_001_pos.ksh}                |    9 +-
 .../zstream/zstream_recompress_002_pos.ksh         |   51 +
 .../zstream/zstream_recompress_003_pos.ksh         |   64 ++
 .../zstream/zstream_recompress_004_pos.ksh         |   61 ++
 .../zstream/zstream_recompress_005_pos.ksh         |   62 ++
 .../functional/zstream/zstream_redup_001_pos.ksh   |   79 ++
 sys/modules/zfs/zfs_config.h                       |    4 +-
 sys/modules/zfs/zfs_gitrev.h                       |    2 +-
 161 files changed, 6983 insertions(+), 2497 deletions(-)

diff --cc cddl/usr.bin/zstream/Makefile
index b8c17df1aea6,000000000000..98c4b4162878
mode 100644,000000..100644
--- a/cddl/usr.bin/zstream/Makefile
+++ b/cddl/usr.bin/zstream/Makefile
@@@ -1,39 -1,0 +1,44 @@@
 +.PATH: ${ZFSTOP}/cmd/zstream
 +.PATH: ${ZFSTOP}/man/man8
 +
 +PACKAGE=	zfs
 +PROG=	zstream
 +MAN=	zstream.8
 +MLINKS=	zstream.8 zstreamdump.8
 +INCS=	zstream.h
 +SRCS= \
 +	zstream.c \
++	zstream_byteswap.c \
++	zstream_chain.c \
 +	zstream_decompress.c \
 +	zstream_drop_record.c \
 +	zstream_dump.c \
++	zstream_fletcher4.c \
++	zstream_io.c \
 +	zstream_recompress.c  \
 +	zstream_redup.c \
 +	zstream_token.c \
- 	zstream_util.c
++	zstream_util.c \
++	zstream_validate.c
 +
 +SYMLINKS=	zstream ${BINDIR}/zstreamdump
 +
 +WARNS?=	2
 +CFLAGS+= \
 +	-DIN_BASE \
 +	-DZFS_DEBUG \
 +	-I${ZFSTOP}/include \
 +	-I${ZFSTOP}/lib/libspl/include \
 +	-I${ZFSTOP}/lib/libspl/include/os/freebsd \
 +	-I${ZFSTOP}/lib/libzpool/include \
 +	-I${SRCTOP}/sys \
 +	-I${SRCTOP}/cddl/compat/opensolaris/include \
 +	-I${ZFSTOP}/module/icp/include \
 +	-include ${ZFSTOP}/include/sys/simd_config.h \
 +	-include ${ZFSTOP}/include/os/freebsd/spl/sys/ccompile.h \
 +	-DHAVE_ISSETUGID \
 +	-include ${SRCTOP}/sys/modules/zfs/zfs_config.h
 +
 +LIBADD=	geom m nvpair umem avl spl zfs_core zfs zutil zpool pthread
 +
 +.include <bsd.prog.mk>
diff --cc sys/contrib/openzfs/.github/workflows/unit-tests.yml
index 000000000000,0ee27029c166..0ee27029c166
mode 000000,100644..100644
--- a/sys/contrib/openzfs/.github/workflows/unit-tests.yml
+++ b/sys/contrib/openzfs/.github/workflows/unit-tests.yml
diff --cc sys/contrib/openzfs/README.md
index 6a77cedb6355,000000000000..087d7402d6c5
mode 100644,000000..100644
--- a/sys/contrib/openzfs/README.md
+++ b/sys/contrib/openzfs/README.md
@@@ -1,71 -1,0 +1,71 @@@
 +![img](https://openzfs.github.io/openzfs-docs/_static/img/logo/480px-Open-ZFS-Secondary-Logo-Colour-halfsize.png)
 +
 +OpenZFS is an advanced file system and volume manager which was originally
 +developed for Solaris and is now maintained by the OpenZFS community.
 +This repository contains the code for running OpenZFS on Linux and FreeBSD.
 +
 +[![codecov](https://codecov.io/gh/openzfs/zfs/branch/master/graph/badge.svg)](https://codecov.io/gh/openzfs/zfs)
 +[![coverity](https://scan.coverity.com/projects/1973/badge.svg)](https://scan.coverity.com/projects/openzfs-zfs)
 +
 +# Official Resources
 +
 +  * [Documentation](https://openzfs.github.io/openzfs-docs/) - for using and developing this repo
 +  * [ZoL site](https://zfsonlinux.org) - Linux release info & links
 +  * [Mailing lists](https://openzfs.github.io/openzfs-docs/Project%20and%20Community/Mailing%20Lists.html)
 +  * [OpenZFS site](https://openzfs.org/) - for conference videos and info on other platforms (illumos, OSX, Windows, etc)
 +
 +# Installation
 +
 +Full documentation for installing OpenZFS on your favorite operating system can
 +be found at the [Getting Started Page](https://openzfs.github.io/openzfs-docs/Getting%20Started/index.html).
 +
 +# Contribute & Develop
 +
 +We have a separate document with [contribution guidelines](./.github/CONTRIBUTING.md).
 +
 +We have a [Code of Conduct](./CODE_OF_CONDUCT.md).
 +
 +# Release
 +
 +OpenZFS is released under a CDDL license.
 +For more details see the NOTICE, LICENSE and COPYRIGHT files; `UCRL-CODE-235197`
 +
 +# Supported Kernels and Distributions
 +
 +## Linux
 +
 +Given the wide variety of Linux environments, we prioritize development and testing on stable, supported kernels and distributions.
 +
 +### Kernel ([kernel.org](https://kernel.org))
 +
 +All **longterm** kernels from [kernel.org](https://kernel.org) are supported. **stable** kernels are usually supported in the next OpenZFS release.
 +
 +**Supported longterm kernels**: **6.18**, **6.12**, **6.6**, **6.1**, **5.15**, **5.10**.
 +
 +### Red Hat Enterprise Linux (RHEL)
 +
 +All RHEL (and compatible systems: AlmaLinux OS, Rocky Linux, etc) on the **full** or **maintenance** support tracks are supported.
 +
 +**Supported RHEL releases**: **8.10**, **9.7**, **10.1**.
 +
 +### Ubuntu
 +
 +All Ubuntu **LTS** releases are supported.
 +
 +**Supported Ubuntu releases**: **26.04 “Resolute”**, **24.04 “Noble”**, **22.04 “Jammy”**.
 +
 +### Debian
 +
 +All Debian **stable** and **LTS** releases are supported.
 +
 +**Supported Debian releases**: **13 “Trixie”**, **12 “Bookworm”**, **11 “Bullseye”**.
 +
 +### Other Distributions
 +
 +Generally, if a distribution is following an LTS kernel, it should work well with OpenZFS.
 +
 +## FreeBSD
 +
 +All FreeBSD releases receiving [security support](https://www.freebsd.org/security/#sup) are supported by OpenZFS.
 +
- **Supported FreeBSD releases**: **15.0**, **14.4**.
++**Supported FreeBSD releases**: **15.1**, **14.4**.
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_byteswap.c
index 000000000000,bbd76162370e..bbd76162370e
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_byteswap.c
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_byteswap.c
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_byteswap.h
index 000000000000,2ed806ddf2e1..2ed806ddf2e1
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_byteswap.h
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_byteswap.h
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_chain.c
index 000000000000,22317dbf1b23..22317dbf1b23
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_chain.c
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_chain.c
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_chain.h
index 000000000000,2e3c90cbecc5..2e3c90cbecc5
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_chain.h
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_chain.h
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_fletcher4.c
index 000000000000,d7083e507a57..d7083e507a57
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_fletcher4.c
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_fletcher4.c
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_fletcher4.h
index 000000000000,70c797ccb06b..70c797ccb06b
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_fletcher4.h
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_fletcher4.h
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_io.c
index 000000000000,47a0a1fe7773..47a0a1fe7773
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_io.c
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_io.c
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_io.h
index 000000000000,e5239f92cd72..e5239f92cd72
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_io.h
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_io.h
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_modules.h
index 000000000000,143beef5c793..143beef5c793
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_modules.h
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_modules.h
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_recompress.h
index 000000000000,d089f03c77eb..d089f03c77eb
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_recompress.h
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_recompress.h
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_validate.c
index 000000000000,f70bef244cf3..f70bef244cf3
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_validate.c
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_validate.c
diff --cc sys/contrib/openzfs/cmd/zstream/zstream_validate.h
index 000000000000,d8bde7e9c551..d8bde7e9c551
mode 000000,100644..100644
--- a/sys/contrib/openzfs/cmd/zstream/zstream_validate.h
+++ b/sys/contrib/openzfs/cmd/zstream/zstream_validate.h
diff --cc sys/contrib/openzfs/module/os/freebsd/zfs/sysctl_os.c
index a253280df0d6,000000000000..c3eb3e6c779b
mode 100644,000000..100644
--- a/sys/contrib/openzfs/module/os/freebsd/zfs/sysctl_os.c
+++ b/sys/contrib/openzfs/module/os/freebsd/zfs/sysctl_os.c
@@@ -1,805 -1,0 +1,796 @@@
 +// SPDX-License-Identifier: BSD-2-Clause
 +/*
 + * Copyright (c) 2020 iXsystems, Inc.
 + * 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.
 + *
 + */
 +
 +#include <sys/types.h>
 +#include <sys/param.h>
 +#include <sys/systm.h>
 +#include <sys/conf.h>
 +#include <sys/kernel.h>
 +#include <sys/lock.h>
 +#include <sys/malloc.h>
 +#include <sys/mutex.h>
 +#include <sys/proc.h>
 +#include <sys/errno.h>
 +#include <sys/uio.h>
 +#include <sys/buf.h>
 +#include <sys/file.h>
 +#include <sys/kmem.h>
 +#include <sys/conf.h>
 +#include <sys/cmn_err.h>
 +#include <sys/stat.h>
 +#include <sys/zfs_ioctl.h>
 +#include <sys/zfs_vfsops.h>
 +#include <sys/zfs_znode.h>
 +#include <sys/zap.h>
 +#include <sys/spa.h>
 +#include <sys/spa_impl.h>
 +#include <sys/vdev.h>
 +#include <sys/vdev_impl.h>
 +#include <sys/arc_os.h>
 +#include <sys/dmu.h>
 +#include <sys/dsl_dir.h>
 +#include <sys/dsl_dataset.h>
 +#include <sys/dsl_prop.h>
 +#include <sys/dsl_deleg.h>
 +#include <sys/dmu_objset.h>
 +#include <sys/dmu_impl.h>
 +#include <sys/dmu_tx.h>
 +#include <sys/sunddi.h>
 +#include <sys/policy.h>
 +#include <sys/zone.h>
 +#include <sys/nvpair.h>
 +#include <sys/mount.h>
 +#include <sys/taskqueue.h>
 +#include <sys/sdt.h>
 +#include <sys/fs/zfs.h>
 +#include <sys/zfs_ctldir.h>
 +#include <sys/zfs_dir.h>
 +#include <sys/zfs_onexit.h>
 +#include <sys/zvol.h>
 +#include <sys/dsl_scan.h>
 +#include <sys/dmu_objset.h>
 +#include <sys/dmu_send.h>
 +#include <sys/dsl_destroy.h>
 +#include <sys/dsl_bookmark.h>
 +#include <sys/dsl_userhold.h>
 +#include <sys/zfeature.h>
 +#include <sys/zcp.h>
 +#include <sys/zio_checksum.h>
 +#include <sys/vdev_removal.h>
 +#include <sys/dsl_crypt.h>
 +
 +#include <sys/zfs_ioctl_compat.h>
 +#include <sys/zfs_context.h>
 +
 +#include <sys/arc_impl.h>
 +#include <sys/dsl_pool.h>
 +
 +#include <sys/vmmeter.h>
 +
 +SYSCTL_DECL(_vfs_zfs);
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, arc, CTLFLAG_RW, 0,
 +	"ZFS adaptive replacement cache");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, brt, CTLFLAG_RW, 0,
 +	"ZFS Block Reference Table");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, condense, CTLFLAG_RW, 0, "ZFS condense");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, dbuf, CTLFLAG_RW, 0, "ZFS disk buf cache");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, dbuf_cache, CTLFLAG_RW, 0,
 +	"ZFS disk buf cache");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, deadman, CTLFLAG_RW, 0, "ZFS deadman");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, dedup, CTLFLAG_RW, 0, "ZFS dedup");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, l2arc, CTLFLAG_RW, 0, "ZFS l2arc");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, livelist, CTLFLAG_RW, 0, "ZFS livelist");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, lua, CTLFLAG_RW, 0, "ZFS lua");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, metaslab, CTLFLAG_RW, 0, "ZFS metaslab");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, mg, CTLFLAG_RW, 0, "ZFS metaslab group");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, multihost, CTLFLAG_RW, 0,
 +	"ZFS multihost protection");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, prefetch, CTLFLAG_RW, 0, "ZFS prefetch");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, reconstruct, CTLFLAG_RW, 0, "ZFS reconstruct");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, recv, CTLFLAG_RW, 0, "ZFS receive");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, send, CTLFLAG_RW, 0, "ZFS send");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, spa, CTLFLAG_RW, 0, "ZFS space allocation");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, trim, CTLFLAG_RW, 0, "ZFS TRIM");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, txg, CTLFLAG_RW, 0, "ZFS transaction group");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, vdev, CTLFLAG_RW, 0, "ZFS VDEV");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, vnops, CTLFLAG_RW, 0, "ZFS VNOPS");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, zevent, CTLFLAG_RW, 0, "ZFS event");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, zil, CTLFLAG_RW, 0, "ZFS ZIL");
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, zio, CTLFLAG_RW, 0, "ZFS ZIO");
 +
 +SYSCTL_NODE(_vfs_zfs_livelist, OID_AUTO, condense, CTLFLAG_RW, 0,
 +	"ZFS livelist condense");
 +SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, file, CTLFLAG_RW, 0, "ZFS VDEV file");
 +SYSCTL_NODE(_vfs_zfs_vdev, OID_AUTO, mirror, CTLFLAG_RD, 0,
 +	"ZFS VDEV mirror");
 +
 +SYSCTL_DECL(_vfs_zfs_version);
 +SYSCTL_CONST_STRING(_vfs_zfs_version, OID_AUTO, module, CTLFLAG_RD,
 +	(ZFS_META_VERSION "-" ZFS_META_RELEASE), "OpenZFS module version");
 +
 +/* arc.c */
 +
 +int
 +param_set_arc_u64(SYSCTL_HANDLER_ARGS)
 +{
 +	int err;
 +
 +	err = sysctl_handle_64(oidp, arg1, 0, req);
 +	if (err != 0 || req->newptr == NULL)
 +		return (err);
 +
 +	arc_tuning_update(B_TRUE);
 +
 +	return (0);
 +}
 +
 +int
 +param_set_arc_int(SYSCTL_HANDLER_ARGS)
 +{
 +	int err;
 +
 +	err = sysctl_handle_int(oidp, arg1, 0, req);
 +	if (err != 0 || req->newptr == NULL)
 +		return (err);
 +
 +	arc_tuning_update(B_TRUE);
 +
 +	return (0);
 +}
 +
 +static void
 +warn_deprecated_sysctl(const char *old, const char *new)
 +{
 +	printf("WARNING: sysctl vfs.zfs.%s is deprecated. Use vfs.zfs.%s instead.\n",
 +	    old, new);
 +}
 +
 +int
 +param_set_l2arc_dwpd_limit(SYSCTL_HANDLER_ARGS)
 +{
 +	uint64_t old_val = l2arc_dwpd_limit;
 +	int err;
 +
 +	err = sysctl_handle_64(oidp, arg1, 0, req);
 +	if (err != 0 || req->newptr == NULL)
 +		return (err);
 +
 +	if (l2arc_dwpd_limit != old_val)
 +		l2arc_dwpd_bump_reset();
 +
 +	return (0);
 +}
 +
 +int
 +param_set_arc_max(SYSCTL_HANDLER_ARGS)
 +{
 +	unsigned long val;
 +	int err;
 +
 +	val = zfs_arc_max;
 +	err = sysctl_handle_64(oidp, &val, 0, req);
 +	if (err != 0 || req->newptr == NULL)
 +		return (SET_ERROR(err));
 +
 +	if (val != 0 && (val < MIN_ARC_MAX || val <= arc_c_min ||
 +	    val >= arc_all_memory()))
 +		return (SET_ERROR(EINVAL));
 +
 +	zfs_arc_max = val;
 +	arc_tuning_update(B_TRUE);
 +
 +	/* Update the sysctl to the tuned value */
 +	if (val != 0)
 +		zfs_arc_max = arc_c_max;
 +
 +	if (arg2 != 0)
 +		warn_deprecated_sysctl("arc_max", "arc.max");
 +
 +	return (0);
 +}
 +
 +SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_max,
 +	CTLTYPE_ULONG | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
 +	NULL, 1, param_set_arc_max, "LU",
 +	"Maximum ARC size in bytes (LEGACY)");
 +
 +int
 +param_set_arc_min(SYSCTL_HANDLER_ARGS)
 +{
 +	unsigned long val;
 +	int err;
 +
 +	val = zfs_arc_min;
 +	err = sysctl_handle_64(oidp, &val, 0, req);
 +	if (err != 0 || req->newptr == NULL)
 +		return (SET_ERROR(err));
 +
 +	if (val != 0 && (val < 2ULL << SPA_MAXBLOCKSHIFT || val > arc_c_max))
 +		return (SET_ERROR(EINVAL));
 +
 +	zfs_arc_min = val;
 +	arc_tuning_update(B_TRUE);
 +
 +	/* Update the sysctl to the tuned value */
 +	if (val != 0)
 +		zfs_arc_min = arc_c_min;
 +
 +	if (arg2 != 0)
 +		warn_deprecated_sysctl("arc_min", "arc.min");
 +
 +	return (0);
 +}
 +
 +SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_min,
 +	CTLTYPE_ULONG | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
 +	NULL, 1, param_set_arc_min, "LU",
 +	"Minimum ARC size in bytes (LEGACY)");
 +
 +extern uint_t zfs_arc_free_target;
 +
 +int
 +param_set_arc_free_target(SYSCTL_HANDLER_ARGS)
 +{
 +	uint_t val;
 +	int err;
 +
 +	val = zfs_arc_free_target;
 +	err = sysctl_handle_int(oidp, &val, 0, req);
 +	if (err != 0 || req->newptr == NULL)
 +		return (err);
 +
 +	if (val < minfree)
 +		return (EINVAL);
 +	if (val > vm_cnt.v_page_count)
 +		return (EINVAL);
 +
 +	zfs_arc_free_target = val;
 +
 +	if (arg2 != 0)
 +		warn_deprecated_sysctl("arc_free_target", "arc.free_target");
 +
 +	return (0);
 +}
 +
 +/*
 + * NOTE: This sysctl is CTLFLAG_RW not CTLFLAG_RWTUN due to its dependency on
 + * pagedaemon initialization.
 + */
 +SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_free_target,
 +	CTLTYPE_UINT | CTLFLAG_RW | CTLFLAG_MPSAFE,
 +	NULL, 1, param_set_arc_free_target, "IU",
 +	"Desired number of free pages below which ARC triggers reclaim"
 +	" (LEGACY)");
 +
 +int
 +param_set_arc_no_grow_shift(SYSCTL_HANDLER_ARGS)
 +{
 +	int err, val;
 +
 +	val = zfs_arc_no_grow_shift;
 +	err = sysctl_handle_int(oidp, &val, 0, req);
 +	if (err != 0 || req->newptr == NULL)
 +		return (err);
 +
 +	if (val < 0 || val >= arc_shrink_shift)
 +		return (EINVAL);
 +
 +	zfs_arc_no_grow_shift = val;
 +
 +	if (arg2 != 0)
 +		warn_deprecated_sysctl("arc_no_grow_shift", "arc.no_grow_shift");
 +
 +	return (0);
 +}
 +
 +SYSCTL_PROC(_vfs_zfs, OID_AUTO, arc_no_grow_shift,
 +	CTLTYPE_INT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE,
 +	NULL, 1, param_set_arc_no_grow_shift, "I",
 +	"log2(fraction of ARC which must be free to allow growing) (LEGACY)");
 +
 +#if 0
 +extern uint64_t l2arc_write_max;
 +
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_write_max,
 +	CTLFLAG_RWTUN, &l2arc_write_max, 0,
 +	"Max write bytes per interval (LEGACY)");
 +
 +extern uint64_t l2arc_write_boost;
 +
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_write_boost,
 +	CTLFLAG_RWTUN, &l2arc_write_boost, 0,
 +	"Extra write bytes during device warmup (LEGACY)");
 +
 +extern uint64_t l2arc_headroom;
 +
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_headroom,
 +	CTLFLAG_RWTUN, &l2arc_headroom, 0,
 +	"Number of max device writes to precache (LEGACY)");
 +
 +extern uint64_t l2arc_headroom_boost;
 +
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_headroom_boost,
 +	CTLFLAG_RWTUN, &l2arc_headroom_boost, 0,
 +	"Compressed l2arc_headroom multiplier (LEGACY)");
 +
 +extern uint64_t l2arc_feed_secs;
 +
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_feed_secs,
 +	CTLFLAG_RWTUN, &l2arc_feed_secs, 0,
 +	"Seconds between L2ARC writing (LEGACY)");
 +
 +extern uint64_t l2arc_feed_min_ms;
 +
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, l2arc_feed_min_ms,
 +	CTLFLAG_RWTUN, &l2arc_feed_min_ms, 0,
 +	"Min feed interval in milliseconds (LEGACY)");
 +
 +extern int l2arc_noprefetch;
 +
 +SYSCTL_INT(_vfs_zfs, OID_AUTO, l2arc_noprefetch,
 +	CTLFLAG_RWTUN, &l2arc_noprefetch, 0,
 +	"Skip caching prefetched buffers (LEGACY)");
 +
 +extern int l2arc_feed_again;
 +
 +SYSCTL_INT(_vfs_zfs, OID_AUTO, l2arc_feed_again,
 +	CTLFLAG_RWTUN, &l2arc_feed_again, 0,
 +	"Turbo L2ARC warmup (LEGACY)");
 +
 +extern int l2arc_norw;
 +
 +SYSCTL_INT(_vfs_zfs, OID_AUTO, l2arc_norw,
 +	CTLFLAG_RWTUN, &l2arc_norw, 0,
 +	"No reads during writes (LEGACY)");
 +
 +#endif
 +
 +static int
 +param_get_arc_state_size(SYSCTL_HANDLER_ARGS)
 +{
 +	arc_state_t *state = (arc_state_t *)arg1;
 +	int64_t val;
 +
 +	val = zfs_refcount_count(&state->arcs_size[ARC_BUFC_DATA]) +
 +	    zfs_refcount_count(&state->arcs_size[ARC_BUFC_METADATA]);
 +	return (sysctl_handle_64(oidp, &val, 0, req));
 +}
 +
 +extern arc_state_t ARC_anon;
 +
 +SYSCTL_PROC(_vfs_zfs, OID_AUTO, anon_size,
 +	CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
 +	&ARC_anon, 0, param_get_arc_state_size, "Q",
 +	"size of anonymous state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, anon_metadata_esize, CTLFLAG_RD,
 +	&ARC_anon.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
 +	"size of evictable metadata in anonymous state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, anon_data_esize, CTLFLAG_RD,
 +	&ARC_anon.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
 +	"size of evictable data in anonymous state");
 +
 +extern arc_state_t ARC_mru;
 +
 +SYSCTL_PROC(_vfs_zfs, OID_AUTO, mru_size,
 +	CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
 +	&ARC_mru, 0, param_get_arc_state_size, "Q",
 +	"size of mru state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_metadata_esize, CTLFLAG_RD,
 +	&ARC_mru.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
 +	"size of evictable metadata in mru state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_data_esize, CTLFLAG_RD,
 +	&ARC_mru.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
 +	"size of evictable data in mru state");
 +
 +extern arc_state_t ARC_mru_ghost;
 +
 +SYSCTL_PROC(_vfs_zfs, OID_AUTO, mru_ghost_size,
 +	CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
 +	&ARC_mru_ghost, 0, param_get_arc_state_size, "Q",
 +	"size of mru ghost state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_ghost_metadata_esize, CTLFLAG_RD,
 +	&ARC_mru_ghost.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
 +	"size of evictable metadata in mru ghost state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mru_ghost_data_esize, CTLFLAG_RD,
 +	&ARC_mru_ghost.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
 +	"size of evictable data in mru ghost state");
 +
 +extern arc_state_t ARC_mfu;
 +
 +SYSCTL_PROC(_vfs_zfs, OID_AUTO, mfu_size,
 +	CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
 +	&ARC_mfu, 0, param_get_arc_state_size, "Q",
 +	"size of mfu state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_metadata_esize, CTLFLAG_RD,
 +	&ARC_mfu.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
 +	"size of evictable metadata in mfu state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_data_esize, CTLFLAG_RD,
 +	&ARC_mfu.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
 +	"size of evictable data in mfu state");
 +
 +extern arc_state_t ARC_mfu_ghost;
 +
 +SYSCTL_PROC(_vfs_zfs, OID_AUTO, mfu_ghost_size,
 +	CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
 +	&ARC_mfu_ghost, 0, param_get_arc_state_size, "Q",
 +	"size of mfu ghost state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_ghost_metadata_esize, CTLFLAG_RD,
 +	&ARC_mfu_ghost.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
 +	"size of evictable metadata in mfu ghost state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, mfu_ghost_data_esize, CTLFLAG_RD,
 +	&ARC_mfu_ghost.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
 +	"size of evictable data in mfu ghost state");
 +
 +extern arc_state_t ARC_uncached;
 +
 +SYSCTL_PROC(_vfs_zfs, OID_AUTO, uncached_size,
 +	CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
 +	&ARC_uncached, 0, param_get_arc_state_size, "Q",
 +	"size of uncached state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, uncached_metadata_esize, CTLFLAG_RD,
 +	&ARC_uncached.arcs_esize[ARC_BUFC_METADATA].rc_count, 0,
 +	"size of evictable metadata in uncached state");
 +SYSCTL_UQUAD(_vfs_zfs, OID_AUTO, uncached_data_esize, CTLFLAG_RD,
 +	&ARC_uncached.arcs_esize[ARC_BUFC_DATA].rc_count, 0,
 +	"size of evictable data in uncached state");
 +
 +extern arc_state_t ARC_l2c_only;
 +
 +SYSCTL_PROC(_vfs_zfs, OID_AUTO, l2c_only_size,
 +	CTLTYPE_S64 | CTLFLAG_RD | CTLFLAG_MPSAFE,
 +	&ARC_l2c_only, 0, param_get_arc_state_size, "Q",
 +	"size of l2c_only state");
 +
 +/* dbuf.c */
 +
 +/* dmu.c */
 +
 +/* dmu_zfetch.c */
 +
 +SYSCTL_NODE(_vfs_zfs, OID_AUTO, zfetch, CTLFLAG_RW, 0, "ZFS ZFETCH (LEGACY)");
 +
 +extern uint32_t	zfetch_max_distance;
 +
 +SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_distance,
 +	CTLFLAG_RWTUN, &zfetch_max_distance, 0,
 +	"Max bytes to prefetch per stream (LEGACY)");
 +
 +extern uint32_t	zfetch_max_idistance;
 +
 +SYSCTL_UINT(_vfs_zfs_zfetch, OID_AUTO, max_idistance,
 +	CTLFLAG_RWTUN, &zfetch_max_idistance, 0,
 +	"Max bytes to prefetch indirects for per stream (LEGACY)");
 +
 +/* dsl_pool.c */
 +
 +/* dnode.c */
 +
 +/* dsl_scan.c */
 +
 +/* metaslab.c */
 +
 +int
 +param_set_active_allocator(SYSCTL_HANDLER_ARGS)
 +{
 +	char buf[16];
 +	int rc;
 +
 +	if (req->newptr == NULL)
 +		strlcpy(buf, zfs_active_allocator, sizeof (buf));
 +
 +	rc = sysctl_handle_string(oidp, buf, sizeof (buf), req);
 +	if (rc || req->newptr == NULL)
 +		return (rc);
 +	if (strcmp(buf, zfs_active_allocator) == 0)
 +		return (0);
 +
 +	return (param_set_active_allocator_common(buf));
 +}
 +
 +/*
 + * The in-core space map representation is more compact than its on-disk form.
 + * The zfs_metaslab_condense_pct determines how much more compact the in-core
 + * space map representation must be before we compact it on-disk.
 + * Values should be greater than or equal to 100.
 + */
 +extern uint_t zfs_metaslab_condense_pct;
 +
 +SYSCTL_UINT(_vfs_zfs_metaslab, OID_AUTO, condense_pct,
 +	CTLFLAG_RWTUN, &zfs_metaslab_condense_pct, 0,
 +	"Condense on-disk spacemap when it is more than this many percents"
 +	" of in-memory counterpart");
 +
 +extern uint_t zfs_remove_max_segment;
 +
 +SYSCTL_UINT(_vfs_zfs, OID_AUTO, remove_max_segment,
 +	CTLFLAG_RWTUN, &zfs_remove_max_segment, 0,
 +	"Largest contiguous segment ZFS will attempt to allocate when removing"
 +	" a device");
 +
 +extern int zfs_removal_suspend_progress;
 +
 +SYSCTL_INT(_vfs_zfs, OID_AUTO, removal_suspend_progress,
 +	CTLFLAG_RWTUN, &zfs_removal_suspend_progress, 0,
 +	"Ensures certain actions can happen while in the middle of a removal");
 +
 +/* mmp.c */
 +
 +int
 +param_set_multihost_interval(SYSCTL_HANDLER_ARGS)
 +{
 +	int err;
 +
 +	err = sysctl_handle_64(oidp, &zfs_multihost_interval, 0, req);
 +	if (err != 0 || req->newptr == NULL)
 +		return (err);
 +
 +	if (spa_mode_global != SPA_MODE_UNINIT)
 +		mmp_signal_all_threads();
 +
 +	return (0);
 +}
 +
- /* spa.c */
- 
- extern int zfs_ccw_retry_interval;
- 
- SYSCTL_INT(_vfs_zfs, OID_AUTO, ccw_retry_interval,
- 	CTLFLAG_RWTUN, &zfs_ccw_retry_interval, 0,
- 	"Configuration cache file write, retry after failure, interval"
- 	" (seconds)");
- 
 +/* spa_misc.c */
 +
 +extern int zfs_flags;
 +
 +static int
 +sysctl_vfs_zfs_debug_flags(SYSCTL_HANDLER_ARGS)
 +{
 +	int err, val;
 +
 +	val = zfs_flags;
 +	err = sysctl_handle_int(oidp, &val, 0, req);
 +	if (err != 0 || req->newptr == NULL)
 +		return (err);
 +
 +	/*
 +	 * ZFS_DEBUG_MODIFY must be enabled prior to boot so all
 +	 * arc buffers in the system have the necessary additional
 +	 * checksum data.  However, it is safe to disable at any
 +	 * time.
 +	 */
 +	if (!(zfs_flags & ZFS_DEBUG_MODIFY))
 +		val &= ~ZFS_DEBUG_MODIFY;
 +	zfs_flags = val;
*** 8664 LINES SKIPPED ***