git: da5137abdf46 - main - zfs: merge openzfs/zfs@bc3f12bfa (master) into main
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 29 Mar 2022 10:27:31 UTC
The branch main has been updated by mm: URL: https://cgit.FreeBSD.org/src/commit/?id=da5137abdf463bb5fee85061958a14dd12bc043e commit da5137abdf463bb5fee85061958a14dd12bc043e Merge: ae6aa2d43daa bc3f12bfac15 Author: Martin Matuska <mm@FreeBSD.org> AuthorDate: 2022-03-29 10:07:34 +0000 Commit: Martin Matuska <mm@FreeBSD.org> CommitDate: 2022-03-29 10:07:34 +0000 zfs: merge openzfs/zfs@bc3f12bfa (master) into main Notable upstream pull request merges: #12083 libzfs: FreeBSD doesn't resize partitions for you #13106 add physical device size to SIZE column in 'zpool list -v' #13158 Allow zfs send to exclude datasets #13190 module: zfs: zio_inject: zio_match_handler: don't << -1 #13219 FreeBSD: add missing replay check to an assert in zfs_xvattr_set #13220 module: freebsd: avoid a taking a destroyed lock in zfs_zevent bits #13221 Fix ACL checks for NFS kernel server Obtained from: OpenZFS OpenZFS commit: bc3f12bfac152a0c28951cec92340ba14f9ccee9 sys/conf/kern.pre.mk | 2 +- .../.github/workflows/zfs-tests-functional.yml | 2 +- .../openzfs/.github/workflows/zfs-tests-sanity.yml | 2 +- sys/contrib/openzfs/META | 2 +- sys/contrib/openzfs/Makefile.am | 7 +- sys/contrib/openzfs/cmd/raidz_test/raidz_bench.c | 2 +- sys/contrib/openzfs/cmd/raidz_test/raidz_test.c | 5 +- sys/contrib/openzfs/cmd/raidz_test/raidz_test.h | 10 +- sys/contrib/openzfs/cmd/zdb/zdb.c | 41 +- sys/contrib/openzfs/cmd/zed/agents/fmd_api.c | 14 +- sys/contrib/openzfs/cmd/zed/agents/fmd_api.h | 7 +- sys/contrib/openzfs/cmd/zed/agents/fmd_serd.c | 12 +- sys/contrib/openzfs/cmd/zed/agents/zfs_diagnosis.c | 1 - sys/contrib/openzfs/cmd/zfs/zfs_iter.c | 1 - sys/contrib/openzfs/cmd/zfs/zfs_main.c | 367 +++++++------ sys/contrib/openzfs/cmd/zfs/zfs_project.c | 2 +- sys/contrib/openzfs/cmd/zgenhostid/zgenhostid.c | 2 +- sys/contrib/openzfs/cmd/zhack/zhack.c | 11 +- sys/contrib/openzfs/cmd/zinject/translate.c | 3 +- sys/contrib/openzfs/cmd/zinject/zinject.c | 3 +- .../openzfs/cmd/zpool/os/linux/zpool_vdev_os.c | 1 - sys/contrib/openzfs/cmd/zpool/zpool_iter.c | 2 +- sys/contrib/openzfs/cmd/zpool/zpool_main.c | 108 ++-- sys/contrib/openzfs/cmd/zpool/zpool_util.c | 2 +- sys/contrib/openzfs/cmd/zstream/zstream.c | 2 +- sys/contrib/openzfs/cmd/zstream/zstream_dump.c | 2 +- sys/contrib/openzfs/cmd/zstream/zstream_redup.c | 6 +- sys/contrib/openzfs/cmd/zstream/zstream_token.c | 2 +- sys/contrib/openzfs/cmd/ztest/ztest.c | 91 ++-- sys/contrib/openzfs/config/Rules.am | 3 + sys/contrib/openzfs/config/always-arch.m4 | 12 +- sys/contrib/openzfs/config/deb.am | 5 +- sys/contrib/openzfs/config/kernel-add-disk.m4 | 5 +- sys/contrib/openzfs/config/kernel-bio.m4 | 37 ++ sys/contrib/openzfs/config/kernel-fpu.m4 | 105 +--- .../openzfs/config/kernel-revalidate-disk-size.m4 | 4 +- sys/contrib/openzfs/config/kernel-zero_page.m4 | 27 + sys/contrib/openzfs/config/kernel.m4 | 2 + sys/contrib/openzfs/config/user-aio.h.m4 | 7 + sys/contrib/openzfs/config/user-libaio.m4 | 2 +- sys/contrib/openzfs/config/user.m4 | 1 + .../openzfs/contrib/pam_zfs_key/pam_zfs_key.c | 2 +- sys/contrib/openzfs/include/libuutil.h | 8 +- .../openzfs/include/os/freebsd/spl/sys/Makefile.am | 2 - .../openzfs/include/os/freebsd/spl/sys/callb.h | 2 +- .../openzfs/include/os/freebsd/spl/sys/cred.h | 136 +---- .../openzfs/include/os/freebsd/spl/sys/kidmap.h | 41 -- .../openzfs/include/os/freebsd/spl/sys/sid.h | 25 - .../openzfs/include/os/freebsd/spl/sys/strings.h | 1 - .../include/os/linux/kernel/linux/simd_x86.h | 245 ++++----- .../openzfs/include/os/linux/spl/sys/Makefile.am | 2 +- .../openzfs/include/os/linux/spl/sys/cred.h | 5 - .../openzfs/include/os/linux/spl/sys/string.h | 1 + .../openzfs/include/os/linux/spl/sys/strings.h | 30 -- .../openzfs/include/os/linux/spl/sys/thread.h | 10 +- sys/contrib/openzfs/include/sys/efi_partition.h | 20 +- sys/contrib/openzfs/include/sys/fs/zfs.h | 1 + sys/contrib/openzfs/include/sys/xvattr.h | 4 +- sys/contrib/openzfs/include/sys/zfs_context.h | 12 +- sys/contrib/openzfs/lib/libefi/rdwr_efi.c | 16 +- sys/contrib/openzfs/lib/libnvpair/libnvpair_json.c | 6 +- sys/contrib/openzfs/lib/libshare/libshare.c | 2 +- sys/contrib/openzfs/lib/libshare/os/freebsd/smb.c | 1 - sys/contrib/openzfs/lib/libshare/os/linux/nfs.c | 1 - sys/contrib/openzfs/lib/libshare/os/linux/smb.c | 1 - .../openzfs/lib/libspl/include/sys/Makefile.am | 3 +- sys/contrib/openzfs/lib/libspl/include/sys/kstat.h | 10 +- .../openzfs/lib/libspl/include/sys/string.h | 1 + .../openzfs/lib/libspl/include/sys/strings.h | 33 -- sys/contrib/openzfs/lib/libspl/include/sys/vtoc.h | 350 ------------ sys/contrib/openzfs/lib/libuutil/uu_pname.c | 4 +- sys/contrib/openzfs/lib/libzfs/libzfs_config.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_crypto.c | 3 +- sys/contrib/openzfs/lib/libzfs/libzfs_dataset.c | 33 +- sys/contrib/openzfs/lib/libzfs/libzfs_import.c | 45 +- sys/contrib/openzfs/lib/libzfs/libzfs_iter.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_mount.c | 2 +- sys/contrib/openzfs/lib/libzfs/libzfs_pool.c | 205 +++---- sys/contrib/openzfs/lib/libzfs/libzfs_sendrecv.c | 10 +- sys/contrib/openzfs/lib/libzfs/libzfs_status.c | 39 +- sys/contrib/openzfs/lib/libzfs/libzfs_util.c | 66 +-- .../openzfs/lib/libzfs/os/freebsd/libzfs_compat.c | 6 +- .../openzfs/lib/libzfs/os/linux/libzfs_mount_os.c | 2 +- .../openzfs/lib/libzfs/os/linux/libzfs_pool_os.c | 14 +- sys/contrib/openzfs/lib/libzpool/kernel.c | 4 +- sys/contrib/openzfs/lib/libzpool/taskq.c | 2 +- .../lib/libzutil/os/linux/zutil_device_path_os.c | 11 +- .../lib/libzutil/os/linux/zutil_import_os.c | 34 +- .../openzfs/lib/libzutil/zutil_device_path.c | 39 +- sys/contrib/openzfs/lib/libzutil/zutil_import.c | 6 + sys/contrib/openzfs/man/man7/zpoolconcepts.7 | 2 +- sys/contrib/openzfs/man/man8/zdb.8 | 29 +- sys/contrib/openzfs/man/man8/zfs-allow.8 | 108 +++- sys/contrib/openzfs/man/man8/zfs-bookmark.8 | 10 +- sys/contrib/openzfs/man/man8/zfs-clone.8 | 28 +- sys/contrib/openzfs/man/man8/zfs-create.8 | 35 +- sys/contrib/openzfs/man/man8/zfs-destroy.8 | 50 +- sys/contrib/openzfs/man/man8/zfs-diff.8 | 21 +- sys/contrib/openzfs/man/man8/zfs-list.8 | 31 +- sys/contrib/openzfs/man/man8/zfs-promote.8 | 22 +- sys/contrib/openzfs/man/man8/zfs-receive.8 | 44 +- sys/contrib/openzfs/man/man8/zfs-rename.8 | 39 +- sys/contrib/openzfs/man/man8/zfs-rollback.8 | 13 +- sys/contrib/openzfs/man/man8/zfs-send.8 | 63 ++- sys/contrib/openzfs/man/man8/zfs-set.8 | 128 ++++- sys/contrib/openzfs/man/man8/zfs-snapshot.8 | 60 ++- sys/contrib/openzfs/man/man8/zfs.8 | 68 ++- sys/contrib/openzfs/man/man8/zpool-add.8 | 25 +- sys/contrib/openzfs/man/man8/zpool-create.8 | 34 +- sys/contrib/openzfs/man/man8/zpool-destroy.8 | 11 +- sys/contrib/openzfs/man/man8/zpool-export.8 | 11 +- sys/contrib/openzfs/man/man8/zpool-import.8 | 26 +- sys/contrib/openzfs/man/man8/zpool-iostat.8 | 42 +- sys/contrib/openzfs/man/man8/zpool-list.8 | 36 +- sys/contrib/openzfs/man/man8/zpool-remove.8 | 44 +- sys/contrib/openzfs/man/man8/zpool-scrub.8 | 14 +- sys/contrib/openzfs/man/man8/zpool-status.8 | 29 +- sys/contrib/openzfs/man/man8/zpool-upgrade.8 | 13 +- sys/contrib/openzfs/man/man8/zpool.8 | 87 +-- sys/contrib/openzfs/module/Makefile.bsd | 2 +- sys/contrib/openzfs/module/icp/algs/aes/aes_impl.c | 12 +- sys/contrib/openzfs/module/icp/algs/edonr/edonr.c | 42 +- sys/contrib/openzfs/module/icp/algs/modes/cbc.c | 30 +- sys/contrib/openzfs/module/icp/algs/modes/ccm.c | 102 ++-- sys/contrib/openzfs/module/icp/algs/modes/ctr.c | 21 +- sys/contrib/openzfs/module/icp/algs/modes/ecb.c | 14 +- sys/contrib/openzfs/module/icp/algs/modes/gcm.c | 86 +-- sys/contrib/openzfs/module/icp/algs/modes/modes.c | 2 +- sys/contrib/openzfs/module/icp/algs/sha2/sha2.c | 18 +- sys/contrib/openzfs/module/icp/algs/skein/skein.c | 136 +++-- .../openzfs/module/icp/algs/skein/skein_impl.h | 2 +- .../openzfs/module/icp/algs/skein/skein_port.h | 4 +- sys/contrib/openzfs/module/icp/api/kcf_ctxops.c | 2 +- .../openzfs/module/icp/core/kcf_mech_tabs.c | 3 +- sys/contrib/openzfs/module/icp/core/kcf_prov_lib.c | 6 +- sys/contrib/openzfs/module/icp/io/aes.c | 23 +- sys/contrib/openzfs/module/icp/io/sha2_mod.c | 50 +- sys/contrib/openzfs/module/icp/io/skein_mod.c | 26 +- sys/contrib/openzfs/module/lua/ldo.c | 2 +- sys/contrib/openzfs/module/nvpair/nvpair.c | 54 +- .../openzfs/module/os/freebsd/spl/acl_common.c | 3 +- .../openzfs/module/os/freebsd/spl/sha256c.c | 4 +- .../openzfs/module/os/freebsd/spl/sha512c.c | 8 +- .../openzfs/module/os/freebsd/spl/spl_acl.c | 8 +- .../openzfs/module/os/freebsd/spl/spl_sysevent.c | 12 +- .../openzfs/module/os/freebsd/spl/spl_vfs.c | 2 +- .../openzfs/module/os/freebsd/spl/spl_zlib.c | 7 +- .../openzfs/module/os/freebsd/spl/spl_zone.c | 4 +- sys/contrib/openzfs/module/os/freebsd/zfs/abd_os.c | 2 +- .../openzfs/module/os/freebsd/zfs/crypto_os.c | 34 +- sys/contrib/openzfs/module/os/freebsd/zfs/dmu_os.c | 12 +- sys/contrib/openzfs/module/os/freebsd/zfs/hkdf.c | 2 +- .../openzfs/module/os/freebsd/zfs/zfs_acl.c | 30 +- .../openzfs/module/os/freebsd/zfs/zfs_ctldir.c | 4 +- .../openzfs/module/os/freebsd/zfs/zfs_vnops_os.c | 25 +- .../openzfs/module/os/freebsd/zfs/zfs_znode.c | 2 +- .../openzfs/module/os/freebsd/zfs/zio_crypt.c | 148 ++--- sys/contrib/openzfs/module/os/linux/spl/spl-cred.c | 42 +- .../openzfs/module/os/linux/spl/spl-generic.c | 3 +- .../openzfs/module/os/linux/spl/spl-thread.c | 9 - sys/contrib/openzfs/module/os/linux/zfs/abd_os.c | 15 +- sys/contrib/openzfs/module/os/linux/zfs/policy.c | 10 +- .../openzfs/module/os/linux/zfs/qat_crypt.c | 10 +- .../openzfs/module/os/linux/zfs/vdev_disk.c | 4 + sys/contrib/openzfs/module/os/linux/zfs/zfs_acl.c | 24 +- sys/contrib/openzfs/module/os/linux/zfs/zfs_dir.c | 4 +- sys/contrib/openzfs/module/os/linux/zfs/zfs_uio.c | 12 +- .../openzfs/module/os/linux/zfs/zfs_vfsops.c | 2 +- .../openzfs/module/os/linux/zfs/zfs_znode.c | 6 +- .../openzfs/module/os/linux/zfs/zio_crypt.c | 132 ++--- .../openzfs/module/os/linux/zfs/zpl_inode.c | 4 +- .../openzfs/module/os/linux/zfs/zpl_xattr.c | 4 +- sys/contrib/openzfs/module/os/linux/zfs/zvol_os.c | 2 +- sys/contrib/openzfs/module/unicode/u8_textprep.c | 2 +- sys/contrib/openzfs/module/zcommon/zfs_deleg.c | 2 +- sys/contrib/openzfs/module/zcommon/zfs_fletcher.c | 4 +- .../module/zcommon/zfs_fletcher_aarch64_neon.c | 4 +- .../openzfs/module/zcommon/zfs_fletcher_avx512.c | 4 +- .../openzfs/module/zcommon/zfs_fletcher_intel.c | 4 +- .../openzfs/module/zcommon/zfs_fletcher_sse.c | 4 +- .../module/zcommon/zfs_fletcher_superscalar.c | 4 +- .../module/zcommon/zfs_fletcher_superscalar4.c | 4 +- sys/contrib/openzfs/module/zcommon/zfs_prop.c | 6 +- sys/contrib/openzfs/module/zfs/aggsum.c | 2 +- sys/contrib/openzfs/module/zfs/arc.c | 87 +-- sys/contrib/openzfs/module/zfs/blkptr.c | 2 +- sys/contrib/openzfs/module/zfs/bpobj.c | 6 +- sys/contrib/openzfs/module/zfs/btree.c | 2 +- sys/contrib/openzfs/module/zfs/dataset_kstats.c | 2 +- sys/contrib/openzfs/module/zfs/dbuf.c | 42 +- sys/contrib/openzfs/module/zfs/ddt.c | 30 +- sys/contrib/openzfs/module/zfs/dmu.c | 8 +- sys/contrib/openzfs/module/zfs/dmu_objset.c | 6 +- sys/contrib/openzfs/module/zfs/dmu_recv.c | 21 +- sys/contrib/openzfs/module/zfs/dmu_redact.c | 4 +- sys/contrib/openzfs/module/zfs/dmu_send.c | 34 +- sys/contrib/openzfs/module/zfs/dmu_traverse.c | 4 +- sys/contrib/openzfs/module/zfs/dnode.c | 52 +- sys/contrib/openzfs/module/zfs/dnode_sync.c | 14 +- sys/contrib/openzfs/module/zfs/dsl_bookmark.c | 15 +- sys/contrib/openzfs/module/zfs/dsl_crypt.c | 31 +- sys/contrib/openzfs/module/zfs/dsl_dataset.c | 14 +- sys/contrib/openzfs/module/zfs/dsl_deadlist.c | 2 +- sys/contrib/openzfs/module/zfs/dsl_scan.c | 28 +- sys/contrib/openzfs/module/zfs/edonr_zfs.c | 8 +- sys/contrib/openzfs/module/zfs/gzip.c | 5 +- sys/contrib/openzfs/module/zfs/hkdf.c | 2 +- sys/contrib/openzfs/module/zfs/metaslab.c | 14 +- sys/contrib/openzfs/module/zfs/mmp.c | 9 +- sys/contrib/openzfs/module/zfs/range_tree.c | 8 +- sys/contrib/openzfs/module/zfs/sa.c | 17 +- sys/contrib/openzfs/module/zfs/skein_zfs.c | 13 +- sys/contrib/openzfs/module/zfs/spa.c | 8 +- sys/contrib/openzfs/module/zfs/spa_checkpoint.c | 2 +- sys/contrib/openzfs/module/zfs/spa_misc.c | 5 +- sys/contrib/openzfs/module/zfs/space_map.c | 5 +- sys/contrib/openzfs/module/zfs/txg.c | 12 +- sys/contrib/openzfs/module/zfs/vdev.c | 7 +- sys/contrib/openzfs/module/zfs/vdev_draid.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_indirect.c | 6 +- .../openzfs/module/zfs/vdev_indirect_births.c | 2 +- .../openzfs/module/zfs/vdev_indirect_mapping.c | 4 +- sys/contrib/openzfs/module/zfs/vdev_initialize.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_label.c | 2 +- sys/contrib/openzfs/module/zfs/vdev_raidz.c | 4 +- sys/contrib/openzfs/module/zfs/vdev_rebuild.c | 14 +- sys/contrib/openzfs/module/zfs/vdev_removal.c | 4 +- sys/contrib/openzfs/module/zfs/vdev_trim.c | 18 +- sys/contrib/openzfs/module/zfs/zap.c | 2 +- sys/contrib/openzfs/module/zfs/zap_leaf.c | 9 +- sys/contrib/openzfs/module/zfs/zap_micro.c | 6 +- sys/contrib/openzfs/module/zfs/zfs_fm.c | 2 +- sys/contrib/openzfs/module/zfs/zfs_log.c | 34 +- sys/contrib/openzfs/module/zfs/zfs_replay.c | 15 +- sys/contrib/openzfs/module/zfs/zfs_sa.c | 11 +- sys/contrib/openzfs/module/zfs/zfs_vnops.c | 3 +- sys/contrib/openzfs/module/zfs/zil.c | 33 +- sys/contrib/openzfs/module/zfs/zio.c | 14 +- sys/contrib/openzfs/module/zfs/zio_checksum.c | 2 +- sys/contrib/openzfs/module/zfs/zio_inject.c | 3 +- sys/contrib/openzfs/module/zfs/zthr.c | 2 +- sys/contrib/openzfs/module/zstd/Makefile.in | 5 + .../module/zstd/include/zstd_compat_wrapper.h | 597 ++++++++++----------- sys/contrib/openzfs/rpm/generic/zfs-dkms.spec.in | 45 +- sys/contrib/openzfs/rpm/generic/zfs.spec.in | 27 +- sys/contrib/openzfs/scripts/zfs-tests.sh | 9 +- sys/contrib/openzfs/tests/runfiles/common.run | 8 +- sys/contrib/openzfs/tests/runfiles/sanity.run | 2 +- .../tests/test-runner/bin/test-runner.py.in | 33 +- .../openzfs/tests/test-runner/include/logapi.shlib | 18 +- .../openzfs/tests/zfs-tests/cmd/draid/draid.c | 36 +- .../openzfs/tests/zfs-tests/cmd/file_common.h | 2 +- .../cmd/libzfs_input_check/libzfs_input_check.c | 11 +- .../openzfs/tests/zfs-tests/cmd/mkbusy/mkbusy.c | 6 +- .../openzfs/tests/zfs-tests/cmd/mkfile/mkfile.c | 15 +- .../zfs-tests/cmd/nvlist_to_lua/nvlist_to_lua.c | 7 +- .../zfs-tests/cmd/randwritecomp/randwritecomp.c | 17 +- .../tests/zfs-tests/cmd/rename_dir/rename_dir.c | 15 +- .../cmd/rm_lnkcnt_zero_file/rm_lnkcnt_zero_file.c | 1 - .../tests/functional/checksum/edonr_test.c | 4 +- .../tests/functional/checksum/sha2_test.c | 4 +- .../tests/functional/checksum/skein_test.c | 6 +- .../tests/functional/cli_root/zfs/zfs_002_pos.ksh | 8 +- .../cli_root/zfs_get/zfs_get_001_pos.ksh | 14 +- .../cli_root/zfs_get/zfs_get_002_pos.ksh | 6 +- .../cli_root/zfs_get/zfs_get_005_neg.ksh | 14 +- .../cli_root/zfs_get/zfs_get_006_neg.ksh | 3 +- .../cli_root/zfs_get/zfs_get_007_neg.ksh | 2 +- .../cli_root/zfs_set/zfs_set_common.kshlib | 8 +- .../tests/functional/cli_root/zfs_wait/Makefile.am | 3 +- .../cli_root/zfs_wait/zfs_wait_getsubopt.ksh | 14 + .../cli_root/zpool_get/zpool_get_004_neg.ksh | 3 +- .../cli_root/zpool_wait/zpool_wait_usage.ksh | 2 + .../tests/functional/cli_user/zfs_list/Makefile.am | 1 + .../cli_user/zfs_list/zfs_list_005_neg.ksh | 14 + .../tests/zfs-tests/tests/functional/ctime/ctime.c | 1 - .../tests/functional/history/history_007_pos.ksh | 16 +- .../zfs-tests/tests/functional/hkdf/hkdf_test.c | 21 +- .../largest_pool/largest_pool_001_pos.ksh | 4 +- .../pool_checkpoint/checkpoint_lun_expsz.ksh | 6 +- .../zfs-tests/tests/functional/rsend/Makefile.am | 5 + .../zfs-tests/tests/functional/rsend/rsend.kshlib | 22 +- .../tests/functional/rsend/rsend_011_pos.ksh | 10 +- .../tests/functional/rsend/rsend_012_pos.ksh | 16 +- .../tests/functional/rsend/rsend_025_pos.ksh | 90 ++++ .../tests/functional/rsend/rsend_026_neg.ksh | 58 ++ .../tests/functional/rsend/rsend_027_pos.ksh | 92 ++++ .../tests/functional/rsend/rsend_028_neg.ksh | 58 ++ .../tests/functional/rsend/rsend_029_neg.ksh | 58 ++ sys/modules/zfs/Makefile | 2 +- 290 files changed, 3634 insertions(+), 3310 deletions(-) diff --cc sys/conf/kern.pre.mk index 3ba837d9de11,000000000000..337da3dd822d mode 100644,000000..100644 --- a/sys/conf/kern.pre.mk +++ b/sys/conf/kern.pre.mk @@@ -1,369 -1,0 +1,369 @@@ +# $FreeBSD$ + +# Part of a unified Makefile for building kernels. This part contains all +# of the definitions that need to be before %BEFORE_DEPEND. + +# Allow user to configure things that only effect src tree builds. +# Note: This is duplicated from src.sys.mk to ensure that we include +# /etc/src.conf when building the kernel. Kernels can be built without +# the rest of /usr/src, but they still always process SRCCONF even though +# the normal mechanisms to prevent that (compiling out of tree) won't +# work. To ensure they do work, we have to duplicate thee few lines here. +SRCCONF?= /etc/src.conf +.if (exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf") && !target(_srcconf_included_) +.include "${SRCCONF}" +_srcconf_included_: +.endif + +.include <bsd.own.mk> +.include <bsd.compiler.mk> +.include "kern.opts.mk" + +# The kernel build always occurs in the object directory which is .CURDIR. +.if ${.MAKE.MODE:Unormal:Mmeta} +.MAKE.MODE+= curdirOk=yes +.endif + +# The kernel build always expects .OBJDIR=.CURDIR. +.OBJDIR: ${.CURDIR} + +.if defined(NO_OBJWALK) || ${MK_AUTO_OBJ} == "yes" +NO_OBJWALK= t +NO_MODULES_OBJ= t +.endif +.if !defined(NO_OBJWALK) +_obj= obj +.endif + +# Can be overridden by makeoptions or /etc/make.conf +KERNEL_KO?= kernel +KERNEL?= kernel +KODIR?= /boot/${KERNEL} +LDSCRIPT_NAME?= ldscript.$M +LDSCRIPT?= $S/conf/${LDSCRIPT_NAME} + +M= ${MACHINE} + +AWK?= awk +CP?= cp +ELFDUMP?= elfdump +NM?= nm +OBJCOPY?= objcopy +SIZE?= size + +.if defined(DEBUG) +CTFFLAGS+= -g +.endif +.if ${MACHINE_CPUARCH} == "amd64" && ${COMPILER_TYPE} != "clang" +_COPTFLAGS_EXTRA=-frename-registers +.else +_COPTFLAGS_EXTRA= +.endif +COPTFLAGS?=-O2 -pipe ${_COPTFLAGS_EXTRA} +.if !empty(COPTFLAGS:M-O[23s]) && empty(COPTFLAGS:M-fno-strict-aliasing) +COPTFLAGS+= -fno-strict-aliasing +.endif +.if !defined(NO_CPU_COPTFLAGS) +COPTFLAGS+= ${_CPUCFLAGS} +.endif +NOSTDINC= -nostdinc + +INCLUDES= ${NOSTDINC} ${INCLMAGIC} -I. -I$S -I$S/contrib/ck/include + +CFLAGS= ${COPTFLAGS} ${DEBUG} +CFLAGS+= ${INCLUDES} -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h +CFLAGS_PARAM_INLINE_UNIT_GROWTH?=100 +CFLAGS_PARAM_LARGE_FUNCTION_GROWTH?=1000 +CFLAGS.gcc+= -fms-extensions -finline-limit=${INLINE_LIMIT} +CFLAGS.gcc+= --param inline-unit-growth=${CFLAGS_PARAM_INLINE_UNIT_GROWTH} +CFLAGS.gcc+= --param large-function-growth=${CFLAGS_PARAM_LARGE_FUNCTION_GROWTH} +CFLAGS.gcc+= -fms-extensions +.if defined(CFLAGS_ARCH_PARAMS) +CFLAGS.gcc+=${CFLAGS_ARCH_PARAMS} +.endif +WERROR?= -Werror +# The following should be removed no earlier than LLVM11 being imported into the +# tree, to ensure we don't regress the build. LLVM11 and GCC10 will switch the +# default over to -fno-common, making this redundant. +CFLAGS+= -fno-common + +# XXX LOCORE means "don't declare C stuff" not "for locore.s". +ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC:T}} + +COMPAT_FREEBSD32_ENABLED!= grep COMPAT_FREEBSD32 opt_global.h || true ; echo + +KASAN_ENABLED!= grep KASAN opt_global.h || true ; echo +.if !empty(KASAN_ENABLED) +SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kasan \ + -fsanitize=kernel-address \ + -mllvm -asan-stack=true \ + -mllvm -asan-instrument-dynamic-allocas=true \ + -mllvm -asan-globals=true \ + -mllvm -asan-use-after-scope=true \ + -mllvm -asan-instrumentation-with-call-threshold=0 \ + -mllvm -asan-instrument-byval=false +.endif + +KCSAN_ENABLED!= grep KCSAN opt_global.h || true ; echo +.if !empty(KCSAN_ENABLED) +SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kcsan \ + -fsanitize=thread +.endif + +KMSAN_ENABLED!= grep KMSAN opt_global.h || true ; echo +.if !empty(KMSAN_ENABLED) +SAN_CFLAGS+= -DSAN_NEEDS_INTERCEPTORS -DSAN_INTERCEPTOR_PREFIX=kmsan \ + -fsanitize=kernel-memory +.endif + +KUBSAN_ENABLED!= grep KUBSAN opt_global.h || true ; echo +.if !empty(KUBSAN_ENABLED) +SAN_CFLAGS+= -fsanitize=undefined +.endif + +COVERAGE_ENABLED!= grep COVERAGE opt_global.h || true ; echo +.if !empty(COVERAGE_ENABLED) +.if ${COMPILER_TYPE} == "clang" || \ + (${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 80100) +SAN_CFLAGS+= -fsanitize-coverage=trace-pc,trace-cmp +.else +SAN_CFLAGS+= -fsanitize-coverage=trace-pc +.endif +.endif + +CFLAGS+= ${SAN_CFLAGS} + +GCOV_ENABLED!= grep GCOV opt_global.h || true ; echo +.if !empty(GCOV_ENABLED) +.if ${COMPILER_TYPE} == "gcc" +GCOV_CFLAGS+= -fprofile-arcs -ftest-coverage +.endif +.endif + +CFLAGS+= ${GCOV_CFLAGS} + +# Put configuration-specific C flags last so that they can override +# the others. +CFLAGS+= ${CONF_CFLAGS} + +.if defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mbuild-id} +LDFLAGS+= --build-id=sha1 +.endif + +.if (${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \ + ${MACHINE_CPUARCH} == "i386" || ${MACHINE} == "powerpc") && \ + defined(LINKER_FEATURES) && ${LINKER_FEATURES:Mifunc} == "" && \ + !make(install) +.error amd64/arm64/i386/ppc* kernel requires linker ifunc support +.endif +.if ${MACHINE_CPUARCH} == "amd64" +LDFLAGS+= -z max-page-size=2097152 +.if ${LINKER_TYPE} != "lld" +LDFLAGS+= -z common-page-size=4096 +.else +.if defined(LINKER_FEATURES) && !${LINKER_FEATURES:Mifunc-noplt} +.warning "Linker ${LD} does not support -z ifunc-noplt -> ifunc calls are unoptimized." +.else +LDFLAGS+= -z notext -z ifunc-noplt +.endif +.endif +.endif # ${MACHINE_CPUARCH} == "amd64" + +.if ${MACHINE_CPUARCH} == "riscv" +# Hack: Work around undefined weak symbols being out of range when linking with +# LLD (address is a PC-relative calculation, and BFD works around this by +# rewriting the instructions to generate an absolute address of 0); -fPIE +# avoids this since it uses the GOT for all extern symbols, which is overly +# inefficient for us. Drop once undefined weak symbols work with medany. +.if ${LINKER_TYPE} == "lld" +CFLAGS+= -fPIE +.endif +.endif + +NORMAL_C= ${CC} -c ${CFLAGS} ${WERROR} ${.IMPSRC} +NORMAL_S= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} ${.IMPSRC} +NORMAL_C_NOWERROR= ${CC} -c ${CFLAGS} ${.IMPSRC} + +NORMAL_M= ${AWK} -f $S/tools/makeobjops.awk ${.IMPSRC} -c ; \ + ${CC} -c ${CFLAGS} ${WERROR} ${.PREFIX}.c + +NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC} +NORMAL_FWO= ${CC:N${CCACHE_BIN}} -c ${ASM_CFLAGS} ${WERROR} -o ${.TARGET} \ + $S/kern/firmw.S -DFIRMW_FILE="${.ALLSRC:M*.fw}" \ + -DFIRMW_SYMBOL="${.ALLSRC:M*.fw:C/[-.\/]/_/g}" + +# for ZSTD in the kernel (include zstd/lib/freebsd before other CFLAGS) +ZSTD_C= ${CC} -c -DZSTD_HEAPMODE=1 -I$S/contrib/zstd/lib/freebsd ${CFLAGS} \ + -I$S/contrib/zstd/lib -I$S/contrib/zstd/lib/common ${WERROR} \ + -Wno-missing-prototypes -U__BMI__ -DZSTD_NO_INTRINSICS ${.IMPSRC} +# https://github.com/facebook/zstd/commit/812e8f2a [zstd 1.4.1] +# "Note that [GCC] autovectorization still does not do a good job on the +# optimized version, so it's turned off via attribute and flag. I found +# that neither attribute nor command-line flag were entirely successful in +# turning off vectorization, which is why there were both." +.if ${COMPILER_TYPE} == "gcc" +ZSTD_DECOMPRESS_BLOCK_FLAGS= -fno-tree-vectorize +.endif + +ZINCDIR=$S/contrib/openzfs/include +# Common for dtrace / zfs +CDDL_CFLAGS= \ + -DFREEBSD_NAMECACHE \ + -D_SYS_VMEM_H_ \ + -D__KERNEL \ + -D__KERNEL__ \ + -nostdinc \ + -include $S/modules/zfs/static_ccompile.h \ + -I${ZINCDIR} \ + -I${ZINCDIR}/os/freebsd \ + -I${ZINCDIR}/os/freebsd/spl \ + -I${ZINCDIR}/os/freebsd/zfs \ + -I$S/modules/zfs \ + -I$S/contrib/openzfs/module/zstd/include \ + ${CFLAGS} \ + -Wno-cast-qual \ + -Wno-duplicate-decl-specifier \ + -Wno-missing-braces \ + -Wno-missing-prototypes \ + -Wno-nested-externs \ + -Wno-parentheses \ + -Wno-pointer-arith \ + -Wno-strict-prototypes \ + -Wno-switch \ + -Wno-undef \ + -Wno-uninitialized \ + -Wno-unknown-pragmas \ + -Wno-unused \ + -include ${ZINCDIR}/os/freebsd/spl/sys/ccompile.h \ + -I$S/cddl/contrib/opensolaris/uts/common \ + -I$S -I$S/cddl/compat/opensolaris +CDDL_C= ${CC} -c ${CDDL_CFLAGS} ${WERROR} ${.IMPSRC} + +# Special flags for managing the compat compiles for ZFS +ZFS_CFLAGS+= ${CDDL_CFLAGS} -DBUILDING_ZFS -DHAVE_UIO_ZEROCOPY \ + -DWITH_NETDUMP -D__KERNEL__ -D_SYS_CONDVAR_H_ -DSMP \ - -DIN_FREEBSD_BASE -DHAVE_KSID ++ -DIN_FREEBSD_BASE + +.if ${MACHINE_ARCH} == "amd64" +ZFS_CFLAGS+= -DHAVE_AVX2 -DHAVE_AVX -D__x86_64 -DHAVE_SSE2 -DHAVE_AVX512F \ + -DHAVE_SSSE3 -DHAVE_AVX512BW +.endif + +.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "powerpc" || \ + ${MACHINE_ARCH} == "powerpcspe" || ${MACHINE_ARCH} == "arm" +ZFS_CFLAGS+= -DBITS_PER_LONG=32 +.else +ZFS_CFLAGS+= -DBITS_PER_LONG=64 +.endif + + +ZFS_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${ZFS_CFLAGS} +ZFS_C= ${CC} -c ${ZFS_CFLAGS} ${WERROR} ${.IMPSRC} +ZFS_RPC_C= ${CC} -c ${ZFS_CFLAGS} -DHAVE_RPC_TYPES ${WERROR} ${.IMPSRC} +ZFS_S= ${CC} -c ${ZFS_ASM_CFLAGS} ${WERROR} ${.IMPSRC} + +# ATH driver +ATH_CFLAGS= -I${SRCTOP}/sys/dev/ath ${NO_WUNUSED_BUT_SET_VARIABLE} +ATH_C= ${CC} -c ${CFLAGS} ${WERROR} ${ATH_CFLAGS} ${.IMPSRC} + +# Special flags for managing the compat compiles for DTrace +DTRACE_CFLAGS= -DBUILDING_DTRACE ${CDDL_CFLAGS} -I$S/cddl/dev/dtrace -I$S/cddl/dev/dtrace/${MACHINE_CPUARCH} +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/intel -I$S/cddl/dev/dtrace/x86 +.endif +DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/common/util -I$S -DDIS_MEM -DSMP -I$S/cddl/compat/opensolaris +DTRACE_CFLAGS+= -I$S/cddl/contrib/opensolaris/uts/common +DTRACE_ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${DTRACE_CFLAGS} +DTRACE_C= ${CC} -c ${DTRACE_CFLAGS} ${WERROR} ${.IMPSRC} +DTRACE_S= ${CC} -c ${DTRACE_ASM_CFLAGS} ${WERROR} ${.IMPSRC} + +# Special flags for managing the compat compiles for DTrace/FBT +FBT_CFLAGS= -DBUILDING_DTRACE -nostdinc -I$S/cddl/dev/fbt/${MACHINE_CPUARCH} -I$S/cddl/dev/fbt ${CDDL_CFLAGS} -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" +FBT_CFLAGS+= -I$S/cddl/dev/fbt/x86 +.endif +FBT_C= ${CC} -c ${FBT_CFLAGS} ${WERROR} ${.IMPSRC} + +.if ${MK_CTF} != "no" +NORMAL_CTFCONVERT= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET} +.elif ${MAKE_VERSION} >= 5201111300 +NORMAL_CTFCONVERT= +.else +NORMAL_CTFCONVERT= @: +.endif + +# Linux Kernel Programming Interface C-flags +LINUXKPI_INCLUDES= -I$S/compat/linuxkpi/common/include +LINUXKPI_C= ${NORMAL_C} ${LINUXKPI_INCLUDES} + +# Infiniband C flags. Correct include paths and omit errors that linux +# does not honor. +OFEDINCLUDES= -I$S/ofed/include -I$S/ofed/include/uapi ${LINUXKPI_INCLUDES} +OFEDNOERR= -Wno-cast-qual -Wno-pointer-arith +OFEDCFLAGS= ${CFLAGS:N-I*} -DCONFIG_INFINIBAND_USER_MEM \ + ${OFEDINCLUDES} ${CFLAGS:M-I*} ${OFEDNOERR} +OFED_C_NOIMP= ${CC} -c -o ${.TARGET} ${OFEDCFLAGS} ${WERROR} +OFED_C= ${OFED_C_NOIMP} ${.IMPSRC} + +# mlxfw C flags. +MLXFW_C= ${OFED_C_NOIMP} \ + -I${SRCTOP}/sys/contrib/xz-embedded/freebsd \ + -I${SRCTOP}/sys/contrib/xz-embedded/linux/lib/xz \ + ${.IMPSRC} + +GEN_CFILES= $S/$M/$M/genassym.c ${MFILES:T:S/.m$/.c/} +SYSTEM_CFILES= config.c env.c hints.c vnode_if.c +SYSTEM_DEP= Makefile ${SYSTEM_OBJS} +SYSTEM_OBJS= locore.o ${MDOBJS} ${OBJS} +SYSTEM_OBJS+= ${SYSTEM_CFILES:.c=.o} +SYSTEM_OBJS+= force-dynamic-hack.pico + +KEYMAP=kbdcontrol -P ${SRCTOP}/share/vt/keymaps -P ${SRCTOP}/share/syscons/keymaps +KEYMAP_FIX=sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' + +MD_ROOT_SIZE_CONFIGURED!= grep MD_ROOT_SIZE opt_md.h || true ; echo +.if ${MFS_IMAGE:Uno} != "no" +.if empty(MD_ROOT_SIZE_CONFIGURED) +SYSTEM_OBJS+= embedfs_${MFS_IMAGE:T:R}.o +.endif +.endif +SYSTEM_LD_BASECMD= \ + ${LD} -m ${LD_EMULATION} -Bdynamic -T ${LDSCRIPT} ${_LDFLAGS} \ + --no-warn-mismatch --warn-common --export-dynamic \ + --dynamic-linker /red/herring -X +SYSTEM_LD= @${SYSTEM_LD_BASECMD} -o ${.TARGET} ${SYSTEM_OBJS} vers.o +SYSTEM_LD_TAIL= @${OBJCOPY} --strip-symbol gcc2_compiled. ${.TARGET} ; \ + ${SIZE} ${.TARGET} ; chmod 755 ${.TARGET} +SYSTEM_DEP+= ${LDSCRIPT} + +# Calculate path for .m files early, if needed. +.if !defined(NO_MODULES) && !defined(__MPATH) && !make(install) && \ + (empty(.MAKEFLAGS:M-V) || defined(NO_SKIP_MPATH)) +__MPATH!=find ${S:tA}/ -name \*_if.m +.endif + +# MKMODULESENV is set here so that port makefiles can augment +# them. + +MKMODULESENV+= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${KODIR} +MKMODULESENV+= MACHINE_CPUARCH=${MACHINE_CPUARCH} +MKMODULESENV+= MACHINE=${MACHINE} MACHINE_ARCH=${MACHINE_ARCH} +MKMODULESENV+= MODULES_EXTRA="${MODULES_EXTRA}" WITHOUT_MODULES="${WITHOUT_MODULES}" +MKMODULESENV+= ARCH_FLAGS="${ARCH_FLAGS}" +.if (${KERN_IDENT} == LINT) +MKMODULESENV+= ALL_MODULES=LINT +.endif +.if defined(MODULES_OVERRIDE) +MKMODULESENV+= MODULES_OVERRIDE="${MODULES_OVERRIDE}" +.endif +.if defined(DEBUG) +MKMODULESENV+= DEBUG_FLAGS="${DEBUG}" +.endif +.if !defined(NO_MODULES) +MKMODULESENV+= __MPATH="${__MPATH}" +.endif + +# Detect kernel config options that force stack frames to be turned on. +DDB_ENABLED!= grep DDB opt_ddb.h || true ; echo +DTR_ENABLED!= grep KDTRACE_FRAME opt_kdtrace.h || true ; echo +HWPMC_ENABLED!= grep HWPMC opt_hwpmc_hooks.h || true ; echo diff --cc sys/contrib/openzfs/config/kernel-zero_page.m4 index 000000000000,1461781acb41..1461781acb41 mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/kernel-zero_page.m4 +++ b/sys/contrib/openzfs/config/kernel-zero_page.m4 diff --cc sys/contrib/openzfs/config/user-aio.h.m4 index 000000000000,152c0946722f..152c0946722f mode 000000,100644..100644 --- a/sys/contrib/openzfs/config/user-aio.h.m4 +++ b/sys/contrib/openzfs/config/user-aio.h.m4 diff --cc sys/contrib/openzfs/include/os/linux/spl/sys/string.h index 000000000000,38134dcf4c76..38134dcf4c76 mode 000000,100644..100644 --- a/sys/contrib/openzfs/include/os/linux/spl/sys/string.h +++ b/sys/contrib/openzfs/include/os/linux/spl/sys/string.h diff --cc sys/contrib/openzfs/lib/libspl/include/sys/string.h index 000000000000,3b2f5900276f..3b2f5900276f mode 000000,100644..100644 --- a/sys/contrib/openzfs/lib/libspl/include/sys/string.h +++ b/sys/contrib/openzfs/lib/libspl/include/sys/string.h diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_wait/zfs_wait_getsubopt.ksh index 000000000000,d60aec96b7fe..d60aec96b7fe mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_wait/zfs_wait_getsubopt.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_root/zfs_wait/zfs_wait_getsubopt.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_005_neg.ksh index 000000000000,ae374a6f6c14..ae374a6f6c14 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_005_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/cli_user/zfs_list/zfs_list_005_neg.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_025_pos.ksh index 000000000000,99254cccdbcb..99254cccdbcb mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_025_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_025_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_026_neg.ksh index 000000000000,5248008a18c5..5248008a18c5 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_026_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_026_neg.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_027_pos.ksh index 000000000000,645685e690b4..645685e690b4 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_027_pos.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_027_pos.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_028_neg.ksh index 000000000000,e9186d79344f..e9186d79344f mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_028_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_028_neg.ksh diff --cc sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_029_neg.ksh index 000000000000,7c3a96b71285..7c3a96b71285 mode 000000,100755..100755 --- a/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_029_neg.ksh +++ b/sys/contrib/openzfs/tests/zfs-tests/tests/functional/rsend/rsend_029_neg.ksh diff --cc sys/modules/zfs/Makefile index a6b7512dda2e,000000000000..c0e258691339 mode 100644,000000..100644 --- a/sys/modules/zfs/Makefile +++ b/sys/modules/zfs/Makefile @@@ -1,443 -1,0 +1,443 @@@ +# $FreeBSD$ + +SRCDIR=${SRCTOP}/sys/contrib/openzfs/module +INCDIR=${SRCTOP}/sys/contrib/openzfs/include + +KMOD= zfs + +.PATH: ${SRCDIR}/avl \ + ${SRCDIR}/lua \ + ${SRCDIR}/nvpair \ + ${SRCDIR}/icp/algs/edonr \ + ${SRCDIR}/os/freebsd/spl \ + ${SRCDIR}/os/freebsd/zfs \ + ${SRCDIR}/unicode \ + ${SRCDIR}/zcommon \ + ${SRCDIR}/zfs \ + ${SRCDIR}/zstd \ + ${SRCDIR}/zstd/lib/common \ + ${SRCDIR}/zstd/lib/compress \ + ${SRCDIR}/zstd/lib/decompress + + +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 ++ -D_SYS_VMEM_H_ -DIN_FREEBSD_BASE + +.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 + +# icp +SRCS+= edonr.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 \ + edonr_zfs.c \ + fm.c \ + gzip.c \ + lzjb.c \ + lz4.c \ + lz4_zfs.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 \ *** 211 LINES SKIPPED ***