diff --git a/cddl/lib/libicp/Makefile b/cddl/lib/libicp/Makefile
index d00a47f2529..db791854efa 100644
--- a/cddl/lib/libicp/Makefile
+++ b/cddl/lib/libicp/Makefile
@@ -6,7 +6,6 @@ PACKAGE= zfs
LIB= icp
LIBADD=
-
.if ${MACHINE_ARCH} == "amd64"
ASM_SOURCES_C = asm-x86_64/aes/aeskey.c
ASM_SOURCES_AS = \
@@ -15,30 +14,47 @@ ASM_SOURCES_AS = \
asm-x86_64/modes/gcm_pclmulqdq.S \
asm-x86_64/modes/aesni-gcm-x86_64.S \
asm-x86_64/modes/ghash-x86_64.S \
- asm-x86_64/sha2/sha256_impl.S \
- asm-x86_64/sha2/sha512_impl.S \
+ asm-x86_64/sha2/sha256-x86_64.S \
+ asm-x86_64/sha2/sha512-x86_64.S \
asm-x86_64/blake3/blake3_avx2.S \
asm-x86_64/blake3/blake3_avx512.S \
asm-x86_64/blake3/blake3_sse2.S \
asm-x86_64/blake3/blake3_sse41.S
CFLAGS+= -D__amd64 -D_SYS_STACK_H -UHAVE_AES
+.elif ${MACHINE_ARCH} == "armv7"
+ASM_SOURCES_C =
+ASM_SOURCES_AS = \
+ asm-arm/sha2/sha256-armv7.S \
+ asm-arm/sha2/sha512-armv7.S
.elif ${MACHINE_ARCH} == "aarch64"
ASM_SOURCES_C =
ASM_SOURCES_AS = \
asm-aarch64/blake3/b3_aarch64_sse2.S \
- asm-aarch64/blake3/b3_aarch64_sse41.S
+ asm-aarch64/blake3/b3_aarch64_sse41.S \
+ asm-aarch64/sha2/sha256-armv8.S \
+ asm-aarch64/sha2/sha512-armv8.S
+.elif ${MACHINE_ARCH} == "powerpc64"
+ASM_SOURCES_C =
+ASM_SOURCES_AS = \
+ asm-ppc64/sha2/sha256-ppc.S \
+ asm-ppc64/sha2/sha512-ppc.S \
+ asm-ppc64/sha2/sha256-p8.S \
+ asm-ppc64/sha2/sha512-p8.S
.elif ${MACHINE_ARCH} == "powerpc64le"
ASM_SOURCES_C =
ASM_SOURCES_AS = \
asm-ppc64/blake3/b3_ppc64le_sse2.S \
- asm-ppc64/blake3/b3_ppc64le_sse41.S
+ asm-ppc64/blake3/b3_ppc64le_sse41.S \
+ asm-ppc64/sha2/sha256-ppc.S \
+ asm-ppc64/sha2/sha512-ppc.S \
+ asm-ppc64/sha2/sha256-p8.S \
+ asm-ppc64/sha2/sha512-p8.S
.else
ASM_SOURCES_C =
ASM_SOURCES_AS =
.endif
-
KERNEL_C = \
spi/kcf_spi.c \
api/kcf_ctxops.c \
@@ -52,7 +68,6 @@ KERNEL_C = \
algs/blake3/blake3.c \
algs/blake3/blake3_generic.c \
algs/blake3/blake3_impl.c \
- algs/blake3/blake3_x86-64.c \
algs/edonr/edonr.c \
algs/modes/modes.c \
algs/modes/cbc.c \
@@ -62,7 +77,9 @@ KERNEL_C = \
algs/modes/ctr.c \
algs/modes/ccm.c \
algs/modes/ecb.c \
- algs/sha2/sha2.c \
+ algs/sha2/sha2_generic.c \
+ algs/sha2/sha256_impl.c \
+ algs/sha2/sha512_impl.c \
algs/skein/skein.c \
algs/skein/skein_block.c \
algs/skein/skein_iv.c \
@@ -77,10 +94,8 @@ KERNEL_C = \
core/kcf_prov_tabs.c \
$(ASM_SOURCES_C)
-
-
-
-
+.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zfs
+KERNEL_C+= zfs_impl.c
SRCS= $(ASM_SOURCES_AS) $(KERNEL_C)
@@ -98,22 +113,29 @@ CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccomp
CFLAGS+= -DHAVE_ISSETUGID
CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
-
CFLAGS.aes_amd64.S+= -DLOCORE
CFLAGS.aes_aesni.S+= -DLOCORE
CFLAGS.gcm_pclmulqdq.S+= -DLOCORE
CFLAGS.aesni-gcm-x86_64.S+= -DLOCORE
CFLAGS.ghash-x86_64.S+= -DLOCORE
-CFLAGS.sha256_impl.S+= -DLOCORE
-CFLAGS.sha512_impl.S+= -DLOCORE
+CFLAGS.sha256-x86_64.S+= -DLOCORE
+CFLAGS.sha512-x86_64.S+= -DLOCORE
CFLAGS.blake3_avx2.S = -DLOCORE
CFLAGS.blake3_avx512.S = -DLOCORE
CFLAGS.blake3_sse2.S = -DLOCORE
CFLAGS.blake3_sse41.S = -DLOCORE
CFLAGS.b3_aarch64_sse2.S = -DLOCORE
CFLAGS.b3_aarch64_sse41.S = -DLOCORE
+CFLAGS.sha256-armv7.S = -DLOCORE
+CFLAGS.sha256-armv8.S = -DLOCORE
+CFLAGS.sha512-armv7.S = -DLOCORE
+CFLAGS.sha512-armv8.S = -DLOCORE
CFLAGS.b3_ppc64le_sse2.S = -DLOCORE
CFLAGS.b3_ppc64le_sse41.S = -DLOCORE
+CFLAGS.sha256-p8.S = -DLOCORE
+CFLAGS.sha256-ppc.S = -DLOCORE
+CFLAGS.sha512-p8.S = -DLOCORE
+CFLAGS.sha512-ppc.S = -DLOCORE
LDFLAGS.bfd+= -Wl,-znoexecstack
diff --git a/cddl/lib/libicp_rescue/Makefile b/cddl/lib/libicp_rescue/Makefile
index 6c6c3998f85..7173f94238b 100644
--- a/cddl/lib/libicp_rescue/Makefile
+++ b/cddl/lib/libicp_rescue/Makefile
@@ -6,7 +6,6 @@ PACKAGE= utilities
LIB= icp_rescue
LIBADD=
-
.if ${MACHINE_ARCH} == "amd64"
ASM_SOURCES_C = asm-x86_64/aes/aeskey.c
ASM_SOURCES_AS = \
@@ -14,30 +13,47 @@ ASM_SOURCES_AS = \
asm-x86_64/aes/aes_aesni.S \
asm-x86_64/modes/gcm_pclmulqdq.S \
asm-x86_64/modes/aesni-gcm-x86_64.S \
- asm-x86_64/sha2/sha256_impl.S \
- asm-x86_64/sha2/sha512_impl.S \
+ asm-x86_64/sha2/sha256-x86_64.S \
+ asm-x86_64/sha2/sha512-x86_64.S \
asm-x86_64/blake3/blake3_avx2.S \
asm-x86_64/blake3/blake3_avx512.S \
asm-x86_64/blake3/blake3_sse2.S \
asm-x86_64/blake3/blake3_sse41.S
CFLAGS+= -D__amd64 -D_SYS_STACK_H
+.elif ${MACHINE_ARCH} == "armv7"
+ASM_SOURCES_C =
+ASM_SOURCES_AS = \
+ asm-arm/sha2/sha256-armv7.S \
+ asm-arm/sha2/sha512-armv7.S
.elif ${MACHINE_ARCH} == "aarch64"
ASM_SOURCES_C =
ASM_SOURCES_AS = \
asm-aarch64/blake3/b3_aarch64_sse2.S \
- asm-aarch64/blake3/b3_aarch64_sse41.S
+ asm-aarch64/blake3/b3_aarch64_sse41.S \
+ asm-aarch64/sha2/sha256-armv8.S \
+ asm-aarch64/sha2/sha512-armv8.S
+.elif ${MACHINE_ARCH} == "powerpc64"
+ASM_SOURCES_C =
+ASM_SOURCES_AS = \
+ asm-ppc64/sha2/sha256-ppc.S \
+ asm-ppc64/sha2/sha512-ppc.S \
+ asm-ppc64/sha2/sha256-p8.S \
+ asm-ppc64/sha2/sha512-p8.S
.elif ${MACHINE_ARCH} == "powerpc64le"
ASM_SOURCES_C =
ASM_SOURCES_AS = \
asm-ppc64/blake3/b3_ppc64le_sse2.S \
- asm-ppc64/blake3/b3_ppc64le_sse41.S
+ asm-ppc64/blake3/b3_ppc64le_sse41.S \
+ asm-ppc64/sha2/sha256-ppc.S \
+ asm-ppc64/sha2/sha512-ppc.S \
+ asm-ppc64/sha2/sha256-p8.S \
+ asm-ppc64/sha2/sha512-p8.S
.else
ASM_SOURCES_C =
ASM_SOURCES_AS =
.endif
-
KERNEL_C = \
spi/kcf_spi.c \
api/kcf_ctxops.c \
@@ -51,7 +67,6 @@ KERNEL_C = \
algs/blake3/blake3.c \
algs/blake3/blake3_generic.c \
algs/blake3/blake3_impl.c \
- algs/blake3/blake3_x86-64.c \
algs/edonr/edonr.c \
algs/modes/modes.c \
algs/modes/cbc.c \
@@ -61,7 +76,9 @@ KERNEL_C = \
algs/modes/ctr.c \
algs/modes/ccm.c \
algs/modes/ecb.c \
- algs/sha2/sha2.c \
+ algs/sha2/sha2_generic.c \
+ algs/sha2/sha256_impl.c \
+ algs/sha2/sha512_impl.c \
algs/skein/skein_block.c \
illumos-crypto.c \
io/aes.c \
@@ -74,6 +91,9 @@ KERNEL_C = \
core/kcf_prov_tabs.c \
$(ASM_SOURCES_C)
+.PATH: ${SRCTOP}/sys/contrib/openzfs/module/zfs
+KERNEL_C+= zfs_impl.c
+
SRCS= $(ASM_SOURCES_AS) $(KERNEL_C)
WARNS?= 2
@@ -90,14 +110,13 @@ CFLAGS+= -include ${SRCTOP}/sys/contrib/openzfs/include/os/freebsd/spl/sys/ccomp
CFLAGS+= -DHAVE_ISSETUGID -UHAVE_AVX -DRESCUE
CFLAGS+= -include ${SRCTOP}/sys/modules/zfs/zfs_config.h
-
CFLAGS.aes_amd64.S+= -DLOCORE
CFLAGS.aes_aesni.S+= -DLOCORE
CFLAGS.gcm_pclmulqdq.S+= -DLOCORE
CFLAGS.aesni-gcm-x86_64.S+= -DLOCORE
CFLAGS.ghash-x86_64.S+= -DLOCORE
-CFLAGS.sha256_impl.S+= -DLOCORE
-CFLAGS.sha512_impl.S+= -DLOCORE
+CFLAGS.sha256-x86_64.S+= -DLOCORE
+CFLAGS.sha512-x86_64.S+= -DLOCORE
CFLAGS.gcm.c+= -UCAN_USE_GCM_ASM
CFLAGS.blake3_avx2.S = -DLOCORE
CFLAGS.blake3_avx512.S = -DLOCORE
@@ -105,9 +124,16 @@ CFLAGS.blake3_sse2.S = -DLOCORE
CFLAGS.blake3_sse41.S = -DLOCORE
CFLAGS.b3_aarch64_sse2.S = -DLOCORE
CFLAGS.b3_aarch64_sse41.S = -DLOCORE
+CFLAGS.sha256-armv7.S = -DLOCORE
+CFLAGS.sha512-armv7.S = -DLOCORE
+CFLAGS.sha256-armv8.S = -DLOCORE
+CFLAGS.sha512-armv8.S = -DLOCORE
CFLAGS.b3_ppc64le_sse2.S = -DLOCORE
CFLAGS.b3_ppc64le_sse41.S = -DLOCORE
-
+CFLAGS.sha256-ppc.S = -DLOCORE
+CFLAGS.sha256-p8.S = -DLOCORE
+CFLAGS.sha512-ppc.S = -DLOCORE
+CFLAGS.sha512-p8.S = -DLOCORE
LDFLAGS.bfd+= -Wl,-znoexecstack
diff --git a/cddl/lib/libzfs/Makefile b/cddl/lib/libzfs/Makefile
index 2551b9ebdd5..c8e61202d68 100644
--- a/cddl/lib/libzfs/Makefile
+++ b/cddl/lib/libzfs/Makefile
@@ -55,7 +55,6 @@ USER_C += \
os/freebsd/smb.c
KERNEL_C = \
- algs/sha2/sha2.c \
cityhash.c \
zfeature_common.c \
zfs_comutil.c \
diff --git a/cddl/lib/libzpool/Makefile b/cddl/lib/libzpool/Makefile
index aeb2b4175a3..5dbeb9cb172 100644
--- a/cddl/lib/libzpool/Makefile
+++ b/cddl/lib/libzpool/Makefile
@@ -62,8 +62,9 @@ KERNEL_C = \
bplist.c \
bpobj.c \
bptree.c \
- btree.c \
bqueue.c \
+ btree.c \
+ brt.c \
cityhash.c \
dbuf.c \
dbuf_stats.c \
@@ -117,7 +118,7 @@ KERNEL_C = \
refcount.c \
rrwlock.c \
sa.c \
- sha256.c \
+ sha2_zfs.c \
skein_zfs.c \
spa.c \
spa_checkpoint.c \
diff --git a/cddl/usr.sbin/zdb/Makefile b/cddl/usr.sbin/zdb/Makefile
index 3be2dea0bb9..dcd0c1329b1 100644
--- a/cddl/usr.sbin/zdb/Makefile
+++ b/cddl/usr.sbin/zdb/Makefile
@@ -24,7 +24,7 @@ CFLAGS+= \
-include ${ZFSTOP}/include/os/freebsd/spl/sys/ccompile.h \
-DHAVE_ISSETUGID
-LIBADD= nvpair umem uutil zfs spl avl zutil zpool
+LIBADD= nvpair umem uutil zfs spl avl zutil zpool crypto
CFLAGS.gcc+= -fms-extensions
# Since there are many asserts in this program, it makes no sense to compile
diff --git a/cddl/usr.sbin/zfsd/case_file.cc b/cddl/usr.sbin/zfsd/case_file.cc
index 8da711fc10c..34234a5736a 100644
--- a/cddl/usr.sbin/zfsd/case_file.cc
+++ b/cddl/usr.sbin/zfsd/case_file.cc
@@ -490,8 +490,7 @@ bool
CaseFile::ActivateSpare() {
nvlist_t *config, *nvroot, *parent_config;
nvlist_t **spares;
- char *devPath, *vdev_type;
- const char *poolname;
+ const char *devPath, *poolname, *vdev_type;
u_int nspares, i;
int error;
@@ -518,7 +517,7 @@ CaseFile::ActivateSpare() {
parent_config = find_parent(config, nvroot, m_vdevGUID);
if (parent_config != NULL) {
- char *parent_type;
+ const char *parent_type;
/*
* Don't activate spares for members of a "replacing" vdev.
diff --git a/cddl/usr.sbin/zfsd/vdev.cc b/cddl/usr.sbin/zfsd/vdev.cc
index 508af8cda92..a0e089a5bdf 100644
--- a/cddl/usr.sbin/zfsd/vdev.cc
+++ b/cddl/usr.sbin/zfsd/vdev.cc
@@ -336,7 +336,7 @@ Vdev::Name(zpool_handle_t *zhp, bool verbose) const
string
Vdev::Path() const
{
- char *path(NULL);
+ const char *path(NULL);
if ((m_config != NULL)
&& (nvlist_lookup_string(m_config, ZPOOL_CONFIG_PATH, &path) == 0))
@@ -348,7 +348,7 @@ Vdev::Path() const
string
Vdev::PhysicalPath() const
{
- char *path(NULL);
+ const char *path(NULL);
if ((m_config != NULL) && (nvlist_lookup_string(m_config,
ZPOOL_CONFIG_PHYS_PATH, &path) == 0))
diff --git a/cddl/usr.sbin/zfsd/zfsd_exception.cc b/cddl/usr.sbin/zfsd/zfsd_exception.cc
index 7ebb74ca8c6..e83dd0f6e50 100644
--- a/cddl/usr.sbin/zfsd/zfsd_exception.cc
+++ b/cddl/usr.sbin/zfsd/zfsd_exception.cc
@@ -106,7 +106,7 @@ ZfsdException::Log() const
output << "Pool ";
- char *poolName;
+ const char *poolName;
if (nvlist_lookup_string(m_poolConfig, ZPOOL_CONFIG_POOL_NAME,
&poolName) == 0)
output << poolName;
diff --git a/lib/libbe/be.c b/lib/libbe/be.c
index db06bdbb36a..a5e053cb82d 100644
--- a/lib/libbe/be.c
+++ b/lib/libbe/be.c
@@ -237,7 +237,7 @@ be_dependent_clone_cb(zfs_handle_t *zfs_hdl, void *data)
{
int err;
bool found;
- char *name;
+ const char *name;
struct nvlist *nvl;
struct nvpair *nvp;
struct be_destroy_data *bdd;
@@ -1260,7 +1260,7 @@ be_activate(libbe_handle_t *lbh, const char *bootenv, bool temporary)
{
char be_path[BE_MAXPATHLEN];
nvlist_t *dsprops;
- char *origin;
+ const char *origin;
zfs_handle_t *zhp;
int err;
diff --git a/sbin/bectl/bectl.c b/sbin/bectl/bectl.c
index 814b98ba8a8..bc414d6baf4 100644
--- a/sbin/bectl/bectl.c
+++ b/sbin/bectl/bectl.c
@@ -362,7 +362,8 @@ static int
bectl_cmd_destroy(int argc, char *argv[])
{
nvlist_t *props;
- char *origin, *target, targetds[BE_MAXPATHLEN];
+ char *target, targetds[BE_MAXPATHLEN];
+ const char *origin;
int err, flags, opt;
flags = 0;
@@ -584,13 +585,9 @@ main(int argc, char *argv[])
}
if ((be = libbe_init(root)) == NULL) {
- if (!cmd->silent) {
+ if (!cmd->silent)
fprintf(stderr, "libbe_init(\"%s\") failed.\n",
root != NULL ? root : "");
- if (root == NULL)
- fprintf(stderr,
- "Try specifying ZFS root using -r.\n");
- }
return (-1);
}
diff --git a/sbin/bectl/bectl_jail.c b/sbin/bectl/bectl_jail.c
index 1d7d4a1496a..8e196a14257 100644
--- a/sbin/bectl/bectl_jail.c
+++ b/sbin/bectl/bectl_jail.c
@@ -133,7 +133,8 @@ jailparam_delarg(char *arg)
static int
build_jailcmd(char ***argvp, bool interactive, int argc, char *argv[])
{
- char *cmd, **jargv, *name, *val;
+ char *cmd, **jargv;
+ const char *name, *val;
nvpair_t *nvp;
size_t i, iarg, nargv;
@@ -404,7 +405,7 @@ static int
bectl_locate_jail(const char *ident)
{
nvlist_t *belist, *props;
- char *mnt;
+ const char *mnt;
int jid;
/* Try the easy-match first */
diff --git a/sbin/bectl/bectl_list.c b/sbin/bectl/bectl_list.c
index e43c3000d8f..8fd541419dc 100644
--- a/sbin/bectl/bectl_list.c
+++ b/sbin/bectl/bectl_list.c
@@ -39,8 +39,8 @@ __FBSDID("$FreeBSD$");
#include "bectl.h"
struct sort_column {
- char *name;
- char *val;
+ const char *name;
+ const char *val;
nvlist_t *nvl;
};
@@ -80,7 +80,7 @@ static unsigned long long dataset_space(const char *oname);
static const char *
get_origin_props(nvlist_t *dsprops, nvlist_t **originprops)
{
- char *propstr;
+ const char *propstr;
if (nvlist_lookup_string(dsprops, "origin", &propstr) == 0) {
if (be_prop_list_alloc(originprops) != 0) {
@@ -119,7 +119,8 @@ static unsigned long long
dataset_space(const char *oname)
{
unsigned long long space;
- char *dsname, *propstr, *sep;
+ char *dsname, *sep;
+ const char *propstr;
nvlist_t *dsprops;
space = 0;
@@ -179,8 +180,7 @@ print_info(const char *name, nvlist_t *dsprops, struct printc *pc)
char buf[BUFSZ];
unsigned long long ctimenum, space;
nvlist_t *originprops;
- const char *oname;
- char *dsname, *propstr;
+ const char *oname, *dsname, *propstr;
int active_colsz;
boolean_t active_now, active_reboot, bootonce;
@@ -293,10 +293,9 @@ print_info(const char *name, nvlist_t *dsprops, struct printc *pc)
static void
print_headers(nvlist_t *props, struct printc *pc)
{
- const char *chosen_be_header;
+ const char *chosen_be_header, *propstr;
nvpair_t *cur;
nvlist_t *dsprops;
- char *propstr;
size_t be_maxcol, mount_colsz;
if (pc->show_all_datasets || pc->show_snaps)
diff --git a/stand/libsa/zfs/Makefile.inc b/stand/libsa/zfs/Makefile.inc
index 144b8cf7f31..f4cecdbc308 100644
--- a/stand/libsa/zfs/Makefile.inc
+++ b/stand/libsa/zfs/Makefile.inc
@@ -7,6 +7,7 @@
.PATH: ${OZFS}/module/zstd/lib/common
.PATH: ${OZFS}/module/zstd/lib/compress
.PATH: ${OZFS}/module/zstd/lib/decompress
+.PATH: ${OZFS}/module/icp/asm-aarch64/blake3
.PATH: ${OZFS}/module/icp/algs/blake3
ZFS_SRC= zfs.c nvlist.c skein.c skein_block.c list.c
ZFS_SRC+= zfs_zstd.c
@@ -18,7 +19,11 @@ ZSTD_SRC+= zstd_common.c
ZSTD_SRC+= zstd_ddict.c zstd_decompress.c zstd_decompress_block.c
ZSTD_SRC+= zstd_double_fast.c zstd_fast.c zstd_lazy.c zstd_ldm.c
-SRCS+= ${ZFS_SRC} ${ZSTD_SRC}
+.if ${MACHINE_ARCH} == "aarch64"
+ZFS_SRC_AS = b3_aarch64_sse2.S b3_aarch64_sse41.S
+.endif
+
+SRCS+= ${ZFS_SRC} ${ZSTD_SRC} ${ZFS_SRC_AS}
#
# Any file that needs the FreeBSD overrides that are in
@@ -67,6 +72,9 @@ CFLAGS.zfs.c+= -DHAS_ZSTD_ZFS \
-I${SYSDIR}/crypto/skein \
-I${SRCTOP}/sys/cddl/contrib/opensolaris/common/lz4
+.for i in ${ZFS_SRC_AS}
+CFLAGS.$i+= -DLOCORE
+.endfor
#
# ZSTD coding style has some issues, so suppress clang's warnings. Also, zstd's
# use of BMI instrucitons is broken in this environment, so avoid them.
@@ -82,6 +90,16 @@ CFLAGS.skein_block.c+= -DSKEIN_LOOP=111
# To find blake3_impl.c in OpenZFS tree for our somehat ugly blake3_impl_hack.c
# that's needed until the necessary tweaks can be upstreamed.
-CFLAGS.blake3_impl_hack.c+= -I${OZFS}/module/icp/algs/blake3
+CFLAGS.blake3_impl_hack.c+= -I${OZFS}/module/icp/algs/blake3 -I${OZFS}/module/icp/include
CWARNFLAGS.zfs.c+= ${NO_WDANGLING_POINTER}
+
+b3_aarch64_sse2.o: b3_aarch64_sse2.S
+ ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${.IMPSRC} \
+ -o ${.TARGET}
+ ${CTFCONVERT_CMD}
+
+b3_aarch64_sse41.o: b3_aarch64_sse41.S
+ ${CC} -c ${CFLAGS:N-mgeneral-regs-only} ${WERROR} ${.IMPSRC} \
+ -o ${.TARGET}
+ ${CTFCONVERT_CMD}
diff --git a/stand/libsa/zfs/blake3_impl_hack.c b/stand/libsa/zfs/blake3_impl_hack.c
index bc958b961a0..2be6cc54e77 100644
--- a/stand/libsa/zfs/blake3_impl_hack.c
+++ b/stand/libsa/zfs/blake3_impl_hack.c
@@ -17,6 +17,7 @@ static __inline int isspace(int c)
#include "blake3_impl.c"
+/*
static inline boolean_t blake3_is_not_supported(void)
{
return (B_FALSE);
@@ -33,3 +34,4 @@ const blake3_ops_t blake3_sse41_impl = {
.degree = 4,
.name = "fakesse41"
};
+*/
diff --git a/sys/conf/files b/sys/conf/files
index 94cd7135b27..ff840dce135 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -147,15 +147,16 @@ contrib/openzfs/module/os/freebsd/spl/spl_acl.c optional zfs compile-with "${ZF
contrib/openzfs/module/os/freebsd/spl/spl_dtrace.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/os/freebsd/spl/spl_kstat.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/os/freebsd/spl/spl_policy.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_procfs_list.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/os/freebsd/spl/spl_string.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/os/freebsd/spl/spl_sunddi.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/os/freebsd/spl/spl_sysevent.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/os/freebsd/spl/spl_uio.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/os/freebsd/spl/spl_vfs.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/os/freebsd/spl/spl_vm.c optional zfs compile-with "${ZFS_C}"
-contrib/openzfs/module/os/freebsd/spl/spl_zone.c optional zfs compile-with "${ZFS_C}"
-contrib/openzfs/module/os/freebsd/spl/spl_procfs_list.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/os/freebsd/spl/spl_zlib.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/os/freebsd/spl/spl_zone.c optional zfs compile-with "${ZFS_C}"
+
# zfs specific
@@ -246,7 +247,11 @@ contrib/openzfs/module/icp/algs/edonr/edonr.c optional zfs compile-with "${ZFS_
contrib/openzfs/module/icp/algs/blake3/blake3.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/icp/algs/blake3/blake3_generic.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/icp/algs/blake3/blake3_impl.c optional zfs compile-with "${ZFS_C}"
-contrib/openzfs/module/icp/algs/blake3/blake3_x86-64.c optional zfs compile-with "${ZFS_C}"
+
+# zfs sha2 hash support
+contrib/openzfs/module/icp/algs/sha2/sha2_generic.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/icp/algs/sha2/sha256_impl.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/icp/algs/sha2/sha512_impl.c optional zfs compile-with "${ZFS_C}"
#zfs core common code
contrib/openzfs/module/zfs/abd.c optional zfs compile-with "${ZFS_C}"
@@ -257,6 +262,7 @@ contrib/openzfs/module/zfs/blkptr.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/bplist.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/bpobj.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/bptree.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/brt.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/btree.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/bqueue.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/dbuf.c optional zfs compile-with "${ZFS_C}"
@@ -304,7 +310,7 @@ contrib/openzfs/module/zfs/range_tree.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/refcount.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/rrwlock.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/sa.c optional zfs compile-with "${ZFS_C}"
-contrib/openzfs/module/zfs/sha256.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/sha2_zfs.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/skein_zfs.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/spa.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/spa_checkpoint.c optional zfs compile-with "${ZFS_C}"
@@ -352,6 +358,7 @@ contrib/openzfs/module/zfs/zfs_byteswap.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zfs_chksum.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zfs_fm.c optional zfs compile-with "${ZFS_C} ${NO_WUNUSED_BUT_SET_VARIABLE}"
contrib/openzfs/module/zfs/zfs_fuid.c optional zfs compile-with "${ZFS_C}"
+contrib/openzfs/module/zfs/zfs_impl.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zfs_ioctl.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zfs_log.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zfs/zfs_onexit.c optional zfs compile-with "${ZFS_C}"
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index d93cd146193..f2128aebde1 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -418,11 +418,26 @@ x86/x86/mptable_pci.c optional mptable pci
x86/x86/msi.c optional pci
x86/xen/pv.c optional xenhvm
+# zfs blake3 hash support
contrib/openzfs/module/icp/asm-x86_64/blake3/blake3_avx2.S optional zfs compile-with "${ZFS_S}"
contrib/openzfs/module/icp/asm-x86_64/blake3/blake3_avx512.S optional zfs compile-with "${ZFS_S}"
contrib/openzfs/module/icp/asm-x86_64/blake3/blake3_sse2.S optional zfs compile-with "${ZFS_S}"
contrib/openzfs/module/icp/asm-x86_64/blake3/blake3_sse41.S optional zfs compile-with "${ZFS_S}"
+# zfs sha2 hash support
+zfs-sha256-x86_64.o optional zfs \
+ dependency "$S/contrib/openzfs/module/icp/asm-x86_64/sha2/sha256-x86_64.S" \
+ compile-with "${CC} -c ${ZFS_ASM_CFLAGS} -o ${.TARGET} ${WERROR} $S/contrib/openzfs/module/icp/asm-x86_64/sha2/sha256-x86_64.S" \
+ no-implicit-rule \
+ clean "zfs-sha256-x86_64.o"
+
+zfs-sha512-x86_64.o optional zfs \
+ dependency "$S/contrib/openzfs/module/icp/asm-x86_64/sha2/sha512-x86_64.S" \
+ compile-with "${CC} -c ${ZFS_ASM_CFLAGS} -o ${.TARGET} ${WERROR} $S/contrib/openzfs/module/icp/asm-x86_64/sha2/sha512-x86_64.S" \
+ no-implicit-rule \
+ clean "zfs-sha512-x86_64.o"
+
+# zfs checksums / zcommon
contrib/openzfs/module/zcommon/zfs_fletcher_avx512.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zcommon/zfs_fletcher_intel.c optional zfs compile-with "${ZFS_C}"
contrib/openzfs/module/zcommon/zfs_fletcher_sse.c optional zfs compile-with "${ZFS_C}"
diff --git a/sys/conf/files.arm b/sys/conf/files.arm
index d236c083cc4..60cc5a5a011 100644
--- a/sys/conf/files.arm
+++ b/sys/conf/files.arm
@@ -80,6 +80,11 @@ arm/arm/vfp.c standard
cddl/dev/dtrace/arm/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
cddl/dev/dtrace/arm/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
cddl/dev/fbt/arm/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
+
+# zfs sha2 hash support
+contrib/openzfs/module/icp/asm-arm/sha2/sha256-armv7.S optional zfs compile-with "${ZFS_S}"
+contrib/openzfs/module/icp/asm-arm/sha2/sha512-armv7.S optional zfs compile-with "${ZFS_S}"
+
crypto/des/des_enc.c optional netsmb
dev/cpufreq/cpufreq_dt.c optional cpufreq fdt
dev/dwc/if_dwc.c optional dwc
diff --git a/sys/conf/files.arm64 b/sys/conf/files.arm64
index da63564eba7..461c69edb23 100644
--- a/sys/conf/files.arm64
+++ b/sys/conf/files.arm64
@@ -159,9 +159,24 @@ cddl/dev/dtrace/aarch64/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
cddl/dev/dtrace/aarch64/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
cddl/dev/fbt/aarch64/fbt_isa.c optional dtrace_fbt | dtraceall compile-with "${FBT_C}"
+# zfs blake3 hash support
contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse2.S optional zfs compile-with "${ZFS_S:N-mgeneral-regs-only}"
contrib/openzfs/module/icp/asm-aarch64/blake3/b3_aarch64_sse41.S optional zfs compile-with "${ZFS_S:N-mgeneral-regs-only}"
+# zfs sha2 hash support
+
+zfs-sha256-armv8.o optional zfs \
+ dependency "$S/contrib/openzfs/module/icp/asm-aarch64/sha2/sha256-armv8.S" \
+ compile-with "${CC} -c ${ZFS_ASM_CFLAGS:N-mgeneral-regs-only} -o ${.TARGET} ${WERROR} $S/contrib/openzfs/module/icp/asm-aarch64/sha2/sha256-armv8.S" \
+ no-implicit-rule \
+ clean "zfs-sha256-armv8.o"
+
+zfs-sha512-armv8.o optional zfs \
+ dependency "$S/contrib/openzfs/module/icp/asm-aarch64/sha2/sha512-armv8.S" \
+ compile-with "${CC} -c ${ZFS_ASM_CFLAGS:N-mgeneral-regs-only} -o ${.TARGET} ${WERROR} $S/contrib/openzfs/module/icp/asm-aarch64/sha2/sha512-armv8.S" \
+ no-implicit-rule \
+ clean "zfs-sha512-armv8.o"
+
##
## ASoC support
##
diff --git a/sys/conf/files.powerpc b/sys/conf/files.powerpc
index 444611c6cb5..a55f3e96c19 100644
--- a/sys/conf/files.powerpc
+++ b/sys/conf/files.powerpc
@@ -10,8 +10,17 @@
#
# There is only an asm version on ppc64.
+
+# zfs blake3 hash support
contrib/openzfs/module/icp/asm-ppc64/blake3/b3_ppc64le_sse2.S optional zfs compile-with "${ZFS_S}"
contrib/openzfs/module/icp/asm-ppc64/blake3/b3_ppc64le_sse41.S optional zfs compile-with "${ZFS_S}"
+
+# zfs sha2 hash support
+contrib/openzfs/module/icp/asm-ppc64/sha2/sha256-p8.S optional zfs compile-with "${ZFS_S}"
+contrib/openzfs/module/icp/asm-ppc64/sha2/sha512-p8.S optional zfs compile-with "${ZFS_S}"
+contrib/openzfs/module/icp/asm-ppc64/sha2/sha256-ppc.S optional zfs compile-with "${ZFS_S}"
+contrib/openzfs/module/icp/asm-ppc64/sha2/sha512-ppc.S optional zfs compile-with "${ZFS_S}"
+
cddl/compat/opensolaris/kern/opensolaris_atomic.c optional zfs powerpc | dtrace powerpc | zfs powerpcspe | dtrace powerpcspe compile-with "${ZFS_C}"
cddl/dev/dtrace/powerpc/dtrace_asm.S optional dtrace compile-with "${DTRACE_S}"
cddl/dev/dtrace/powerpc/dtrace_subr.c optional dtrace compile-with "${DTRACE_C}"
diff --git a/sys/contrib/openzfs/.github/workflows/README.md b/sys/contrib/openzfs/.github/workflows/README.md
new file mode 100644
index 00000000000..8255dd21082
--- /dev/null
+++ b/sys/contrib/openzfs/.github/workflows/README.md
@@ -0,0 +1,51 @@
+
+## The testings are done this way
+
+```mermaid
+flowchart TB
+subgraph CleanUp and Summary
+ Part1-20.04-->CleanUp+nice+Summary
+ Part2-20.04-->CleanUp+nice+Summary
+ PartN-20.04-->CleanUp+nice+Summary
+ Part1-22.04-->CleanUp+nice+Summary
+ Part2-22.04-->CleanUp+nice+Summary
+ PartN-22.04-->CleanUp+nice+Summary
+end
+
+subgraph Functional Testings
+ functional-testing-20.04-->Part1-20.04
+ functional-testing-20.04-->Part2-20.04
+ functional-testing-20.04-->PartN-20.04
+ functional-testing-22.04-->Part1-22.04
+ functional-testing-22.04-->Part2-22.04
+ functional-testing-22.04-->PartN-22.04
+end
+
+subgraph Sanity and zloop Testings
+ sanity-checks-20.04-->functional-testing-20.04
+ sanity-checks-22.04-->functional-testing-22.04
+ zloop-checks-20.04-->functional
+ zloop-checks-22.04-->functional
+end
+
+subgraph Code Checking + Building
+ codeql.yml
+ checkstyle.yml
+ Build-Ubuntu-20.04-->sanity-checks-20.04
+ Build-Ubuntu-22.04-->sanity-checks-22.04
+ Build-Ubuntu-20.04-->zloop-checks-20.04
+ Build-Ubuntu-22.04-->zloop-checks-22.04
+end
+```
+
+
+1) build zfs modules for Ubuntu 20.04 and 22.04 (~15m)
+2) 2x zloop test (~10m) + 2x sanity test (~25m)
+3) functional testings in parts 1..5 (each ~1h)
+4) cleanup and create summary
+ - content of summary depends on the results of the steps
+
+When everything runs fine, the full run should be done in
+about 2 hours.
+
+The codeql.yml and checkstyle.yml are not part in this circle.
diff --git a/sys/contrib/openzfs/.github/workflows/checkstyle.yaml b/sys/contrib/openzfs/.github/workflows/checkstyle.yaml
index 008adcc03e0..b0fdc570d47 100644
--- a/sys/contrib/openzfs/.github/workflows/checkstyle.yaml
+++ b/sys/contrib/openzfs/.github/workflows/checkstyle.yaml
@@ -13,8 +13,10 @@ jobs:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install dependencies
run: |
- sudo apt-get update
- sudo apt-get -qq upgrade
+ # https://github.com/orgs/community/discussions/47863
+ sudo apt-mark hold grub-efi-amd64-signed
+ sudo apt-get update --fix-missing
+ sudo apt-get upgrade
sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt apt-get install -qq
sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/checkstyle-dependencies.txt apt-get install -qq
sudo python3 -m pip install --quiet flake8
diff --git a/sys/contrib/openzfs/.github/workflows/scripts/generate-summary.sh b/sys/contrib/openzfs/.github/workflows/scripts/generate-summary.sh
new file mode 100755
index 00000000000..cd5ea3421c9
--- /dev/null
+++ b/sys/contrib/openzfs/.github/workflows/scripts/generate-summary.sh
@@ -0,0 +1,119 @@
+#!/usr/bin/env bash
+
+# for runtime reasons we split functional testings into N parts
+# - use a define to check for missing tarfiles
+FUNCTIONAL_PARTS="4"
+
+ZTS_REPORT="tests/test-runner/bin/zts-report.py"
+chmod +x $ZTS_REPORT
+
+function output() {
+ echo -e $* >> Summary.md
+}
+
+function error() {
+ output ":bangbang: $* :bangbang:\n"
+}
+
+# this function generates the real summary
+# - expects a logfile "log" in current directory
+function generate() {
+ # we issued some error already
+ test ! -s log && return
+
+ # for overview and zts-report
+ cat log | grep '^Test' > list
+
+ # error details
+ awk '/\[FAIL\]|\[KILLED\]/{ show=1; print; next; }
+ /\[SKIP\]|\[PASS\]/{ show=0; } show' log > err
+
+ # summary of errors
+ if [ -s err ]; then
+ output "
"
+ $ZTS_REPORT --no-maybes ./list >> Summary.md
+ output "
"
+
+ # generate seperate error logfile
+ ERRLOGS=$((ERRLOGS+1))
+ errfile="err-$ERRLOGS.md"
+ echo -e "\n## $headline (debugging)\n" >> $errfile
+ echo "Error Listing - with dmesg and dbgmsg
" >> $errfile
+ dd if=err bs=999k count=1 >> $errfile
+ echo "
" >> $errfile
+ else
+ output "All tests passed :thumbsup:"
+ fi
+
+ output "Full Listing
"
+ cat list >> Summary.md
+ output "
"
+
+ # remove tmp files
+ rm -f err list log
+}
+
+# check tarfiles and untar
+function check_tarfile() {
+ if [ -f "$1" ]; then
+ tar xf "$1" || error "Tarfile $1 returns some error"
+ else
+ error "Tarfile $1 not found"
+ fi
+}
+
+# check logfile and concatenate test results
+function check_logfile() {
+ if [ -f "$1" ]; then
+ cat "$1" >> log
+ else
+ error "Logfile $1 not found"
+ fi
+}
+
+# sanity
+function summarize_s() {
+ headline="$1"
+ output "\n## $headline\n"
+ rm -rf testfiles
+ check_tarfile "$2/sanity.tar"
+ check_logfile "testfiles/log"
+ generate
+}
+
+# functional
+function summarize_f() {
+ headline="$1"
+ output "\n## $headline\n"
+ rm -rf testfiles
+ for i in $(seq 1 $FUNCTIONAL_PARTS); do
+ tarfile="$2/part$i.tar"
+ check_tarfile "$tarfile"
+ check_logfile "testfiles/log"
+ done
+ generate
+}
+
+# https://docs.github.com/en/enterprise-server@3.6/actions/using-workflows/workflow-commands-for-github-actions#step-isolation-and-limits
+# Job summaries are isolated between steps and each step is restricted to a maximum size of 1MiB.
+# [ ] can not show all error findings here
+# [x] split files into smaller ones and create additional steps
+
+ERRLOGS=0
+if [ ! -f Summary/Summary.md ]; then
+ # first call, we do the default summary (~500k)
+ echo -n > Summary.md
+ summarize_s "Sanity Tests Ubuntu 20.04" Logs-20.04-sanity
+ summarize_s "Sanity Tests Ubuntu 22.04" Logs-22.04-sanity
+ summarize_f "Functional Tests Ubuntu 20.04" Logs-20.04-functional
+ summarize_f "Functional Tests Ubuntu 22.04" Logs-22.04-functional
+
+ cat Summary.md >> $GITHUB_STEP_SUMMARY
+ mkdir -p Summary
+ mv *.md Summary
+else
+ # here we get, when errors where returned in first call
+ test -f Summary/err-$1.md && cat Summary/err-$1.md >> $GITHUB_STEP_SUMMARY
+fi
+
+exit 0
diff --git a/sys/contrib/openzfs/.github/workflows/scripts/reclaim_disk_space.sh b/sys/contrib/openzfs/.github/workflows/scripts/reclaim_disk_space.sh
deleted file mode 100755
index cc16a907931..00000000000
--- a/sys/contrib/openzfs/.github/workflows/scripts/reclaim_disk_space.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/sh
-
-set -eu
-
-# remove 4GiB of images
-sudo systemd-run docker system prune --force --all --volumes
-
-# remove unused software
-sudo systemd-run rm -rf \
- "$AGENT_TOOLSDIRECTORY" \
- /opt/* \
- /usr/local/* \
- /usr/share/az* \
- /usr/share/dotnet \
- /usr/share/gradle* \
- /usr/share/miniconda \
- /usr/share/swift \
- /var/lib/gems \
- /var/lib/mysql \
- /var/lib/snapd
diff --git a/sys/contrib/openzfs/.github/workflows/scripts/setup-dependencies.sh b/sys/contrib/openzfs/.github/workflows/scripts/setup-dependencies.sh
new file mode 100755
index 00000000000..440d5e8e5ac
--- /dev/null
+++ b/sys/contrib/openzfs/.github/workflows/scripts/setup-dependencies.sh
@@ -0,0 +1,93 @@
+#!/usr/bin/env bash
+
+set -eu
+
+function prerun() {
+ echo "::group::Install build dependencies"
+ # remove snap things, update+upgrade will be faster then
+ for x in lxd core20 snapd; do sudo snap remove $x; done
+ sudo apt-get purge snapd google-chrome-stable firefox
+ # https://github.com/orgs/community/discussions/47863
+ sudo apt-get remove grub-efi-amd64-bin grub-efi-amd64-signed shim-signed --allow-remove-essential
+ sudo apt-get update
+ sudo apt upgrade
+ sudo xargs --arg-file=.github/workflows/build-dependencies.txt apt-get install -qq
+ sudo apt-get clean
+ sudo dmesg -c > /var/tmp/dmesg-prerun
+ echo "::endgroup::"
+}
+
+function mod_build() {
+ echo "::group::Generate debian packages"
+ ./autogen.sh
+ ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan
+ make --no-print-directory --silent native-deb-utils native-deb-kmod
+ mv ../*.deb .
+ rm ./openzfs-zfs-dracut*.deb ./openzfs-zfs-dkms*.deb
+ echo "$ImageOS-$ImageVersion" > tests/ImageOS.txt
+ echo "::endgroup::"
+}
+
+function mod_install() {
+ # install the pre-built module only on the same runner image
+ MOD=`cat tests/ImageOS.txt`
+ if [ "$MOD" != "$ImageOS-$ImageVersion" ]; then
+ rm -f *.deb
+ mod_build
+ fi
+
+ echo "::group::Install and load modules"
+ # don't use kernel-shipped zfs modules
+ sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
+ sudo apt-get install --fix-missing ./*.deb
+
+ # Native Debian packages enable and start the services
+ # Stop zfs-zed daemon, as it may interfere with some ZTS test cases
+ sudo systemctl stop zfs-zed
+ sudo depmod -a
+ sudo modprobe zfs
+ sudo dmesg
+ sudo dmesg -c > /var/tmp/dmesg-module-load
+ echo "::endgroup::"
+
+ echo "::group::Report CPU information"
+ lscpu
+ cat /proc/spl/kstat/zfs/chksum_bench
+ echo "::endgroup::"
+
+ echo "::group::Reclaim and report disk space"
+ # remove 4GiB of images
+ sudo systemd-run docker system prune --force --all --volumes
+
+ # remove unused software
+ sudo systemd-run --wait rm -rf \
+ "$AGENT_TOOLSDIRECTORY" \
+ /opt/* \
+ /usr/local/* \
+ /usr/share/az* \
+ /usr/share/dotnet \
+ /usr/share/gradle* \
+ /usr/share/miniconda \
+ /usr/share/swift \
+ /var/lib/gems \
+ /var/lib/mysql \
+ /var/lib/snapd
+
+ # trim the cleaned space
+ sudo fstrim /
+
+ # disk usage afterwards
+ df -h /
+ echo "::endgroup::"
+}
+
+case "$1" in
+ build)
+ prerun
+ mod_build
+ ;;
+ tests)
+ prerun
+ mod_install
+ ;;
+esac
diff --git a/sys/contrib/openzfs/.github/workflows/scripts/setup-functional.sh b/sys/contrib/openzfs/.github/workflows/scripts/setup-functional.sh
new file mode 100755
index 00000000000..08c4d872abd
--- /dev/null
+++ b/sys/contrib/openzfs/.github/workflows/scripts/setup-functional.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+set -eu
+
+TDIR="/usr/share/zfs/zfs-tests/tests/functional"
+echo -n "TODO="
+case "$1" in
+ part1)
+ # ~1h 20m
+ echo "cli_root"
+ ;;
+ part2)
+ # ~1h
+ ls $TDIR|grep '^[a-m]'|grep -v "cli_root"|xargs|tr -s ' ' ','
+ ;;
+ part3)
+ # ~1h
+ ls $TDIR|grep '^[n-qs-z]'|xargs|tr -s ' ' ','
+ ;;
+ part4)
+ # ~1h
+ ls $TDIR|grep '^r'|xargs|tr -s ' ' ','
+ ;;
+esac
diff --git a/sys/contrib/openzfs/.github/workflows/zfs-linux-tests.yml b/sys/contrib/openzfs/.github/workflows/zfs-linux-tests.yml
new file mode 100644
index 00000000000..c4fe930d092
--- /dev/null
+++ b/sys/contrib/openzfs/.github/workflows/zfs-linux-tests.yml
@@ -0,0 +1,124 @@
+name: zfs-linux-tests
+
+on:
+ workflow_call:
+ inputs:
+ os:
+ description: 'The ubuntu version: 20.02 or 22.04'
+ required: true
+ type: string
+
+jobs:
+
+ zloop:
+ runs-on: ubuntu-${{ inputs.os }}
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ - uses: actions/download-artifact@v3
+ with:
+ name: modules-${{ inputs.os }}
+ - name: Install modules
+ run: |
+ tar xzf modules-${{ inputs.os }}.tgz
+ .github/workflows/scripts/setup-dependencies.sh tests
+ - name: Tests
+ timeout-minutes: 30
+ run: |
+ sudo mkdir -p /var/tmp/zloop
+ # run for 10 minutes or at most 2 iterations for a maximum runner
+ # time of 20 minutes.
+ sudo /usr/share/zfs/zloop.sh -t 600 -I 2 -l -m1 -- -T 120 -P 60
+ - name: Prepare artifacts
+ if: failure()
+ run: |
+ sudo chmod +r -R /var/tmp/zloop/
+ - uses: actions/upload-artifact@v3
+ if: failure()
+ with:
+ name: Zpool-logs-${{ inputs.os }}
+ path: |
+ /var/tmp/zloop/*/
+ !/var/tmp/zloop/*/vdev/
+ retention-days: 14
+ if-no-files-found: ignore
+ - uses: actions/upload-artifact@v3
+ if: failure()
+ with:
+ name: Zpool-files-${{ inputs.os }}
+ path: |
+ /var/tmp/zloop/*/vdev/
+ retention-days: 14
+ if-no-files-found: ignore
+
+ sanity:
+ runs-on: ubuntu-${{ inputs.os }}
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ - uses: actions/download-artifact@v3
+ with:
+ name: modules-${{ inputs.os }}
+ - name: Install modules
+ run: |
+ tar xzf modules-${{ inputs.os }}.tgz
+ .github/workflows/scripts/setup-dependencies.sh tests
+ - name: Tests
+ timeout-minutes: 60
+ shell: bash
+ run: |
+ set -o pipefail
+ /usr/share/zfs/zfs-tests.sh -vKR -s 3G -r sanity | scripts/zfs-tests-color.sh
+ - name: Prepare artifacts
+ if: success() || failure()
+ run: |
+ RESPATH="/var/tmp/test_results"
+ mv -f $RESPATH/current $RESPATH/testfiles
+ tar cf $RESPATH/sanity.tar -h -C $RESPATH testfiles
+ - uses: actions/upload-artifact@v3
+ if: success() || failure()
+ with:
+ name: Logs-${{ inputs.os }}-sanity
+ path: /var/tmp/test_results/sanity.tar
+ if-no-files-found: ignore
+
+ functional:
+ runs-on: ubuntu-${{ inputs.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ tests: [ part1, part2, part3, part4 ]
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ - uses: actions/download-artifact@v3
+ with:
+ name: modules-${{ inputs.os }}
+ - name: Install modules
+ run: |
+ tar xzf modules-${{ inputs.os }}.tgz
+ .github/workflows/scripts/setup-dependencies.sh tests
+ - name: Setup tests
+ run: |
+ .github/workflows/scripts/setup-functional.sh ${{ matrix.tests }} >> $GITHUB_ENV
+ - name: Tests
+ timeout-minutes: 120
+ shell: bash
+ run: |
+ set -o pipefail
+ /usr/share/zfs/zfs-tests.sh -vKR -s 3G -T ${{ env.TODO }} | scripts/zfs-tests-color.sh
+ - name: Prepare artifacts
+ if: success() || failure()
+ run: |
+ RESPATH="/var/tmp/test_results"
+ mv -f $RESPATH/current $RESPATH/testfiles
+ tar cf $RESPATH/${{ matrix.tests }}.tar -h -C $RESPATH testfiles
+ - uses: actions/upload-artifact@v3
+ if: success() || failure()
+ with:
+ name: Logs-${{ inputs.os }}-functional
+ path: /var/tmp/test_results/${{ matrix.tests }}.tar
+ if-no-files-found: ignore
diff --git a/sys/contrib/openzfs/.github/workflows/zfs-linux.yml b/sys/contrib/openzfs/.github/workflows/zfs-linux.yml
new file mode 100644
index 00000000000..be3908deb94
--- /dev/null
+++ b/sys/contrib/openzfs/.github/workflows/zfs-linux.yml
@@ -0,0 +1,64 @@
+name: zfs-linux
+
+on:
+ push:
+ pull_request:
+
+jobs:
+
+ build:
+ name: Build
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [20.04, 22.04]
+ runs-on: ubuntu-${{ matrix.os }}
+ steps:
+ - uses: actions/checkout@v3
+ with:
+ ref: ${{ github.event.pull_request.head.sha }}
+ - name: Build modules
+ run: .github/workflows/scripts/setup-dependencies.sh build
+ - name: Prepare modules upload
+ run: tar czf modules-${{ matrix.os }}.tgz *.deb .github tests/test-runner tests/ImageOS.txt
+ - uses: actions/upload-artifact@v3
+ with:
+ name: modules-${{ matrix.os }}
+ path: modules-${{ matrix.os }}.tgz
+ retention-days: 14
+
+ testings:
+ name: Testing
+ strategy:
+ fail-fast: false
+ matrix:
+ os: [20.04, 22.04]
+ needs: build
+ uses: ./.github/workflows/zfs-linux-tests.yml
+ with:
+ os: ${{ matrix.os }}
+
+ cleanup:
+ if: always()
+ name: Cleanup
+ runs-on: ubuntu-22.04
+ needs: testings
+ steps:
+ - uses: actions/download-artifact@v3
+ - name: Generating summary
+ run: |
+ tar xzf modules-22.04/modules-22.04.tgz .github tests
+ .github/workflows/scripts/generate-summary.sh
+ # up to 4 steps, each can have 1 MiB output (for debugging log files)
+ - name: Summary for errors #1
+ run: .github/workflows/scripts/generate-summary.sh 1
+ - name: Summary for errors #2
+ run: .github/workflows/scripts/generate-summary.sh 2
+ - name: Summary for errors #3
+ run: .github/workflows/scripts/generate-summary.sh 3
+ - name: Summary for errors #4
+ run: .github/workflows/scripts/generate-summary.sh 4
+ - uses: actions/upload-artifact@v3
+ with:
+ name: Summary Files
+ path: Summary/
diff --git a/sys/contrib/openzfs/.github/workflows/zfs-tests-functional.yml b/sys/contrib/openzfs/.github/workflows/zfs-tests-functional.yml
deleted file mode 100644
index 08ce254ec8a..00000000000
--- a/sys/contrib/openzfs/.github/workflows/zfs-tests-functional.yml
+++ /dev/null
@@ -1,84 +0,0 @@
-name: zfs-tests-functional
-
-on:
- push:
- pull_request:
-
-jobs:
- tests-functional-ubuntu:
- strategy:
- fail-fast: false
- matrix:
- os: [20.04, 22.04]
- runs-on: ubuntu-${{ matrix.os }}
- steps:
- - uses: actions/checkout@v3
- with:
- ref: ${{ github.event.pull_request.head.sha }}
- - name: Install dependencies
- run: |
- sudo apt-get update
- sudo apt-get -qq upgrade
- sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt apt-get install -qq
- sudo apt-get clean
- - name: Autogen.sh
- run: |
- ./autogen.sh
- - name: Configure
- run: |
- ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan
- - name: Make
- run: |
- make --no-print-directory --silent native-deb-utils native-deb-kmod
- mv ../*.deb .
- rm ./openzfs-zfs-dkms*.deb ./openzfs-zfs-dracut*.deb
- - name: Install
- run: |
- # Update order of directories to search for modules, otherwise
- # Ubuntu will load kernel-shipped ones.
- sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
- sudo dpkg -i *.deb
- # Native Debian packages enable and start the services
- # Stop zfs-zed daemon, as it may interfere with some ZTS test cases
- sudo systemctl stop zfs-zed
- # Workaround for cloud-init bug
- # see https://github.com/openzfs/zfs/issues/12644
- FILE=/lib/udev/rules.d/10-cloud-init-hook-hotplug.rules
- if [ -r "${FILE}" ]; then
- HASH=$(md5sum "${FILE}" | awk '{ print $1 }')
- if [ "${HASH}" = "121ff0ef1936cd2ef65aec0458a35772" ]; then
- # Just shove a zd* exclusion right above the hotplug hook...
- sudo sed -i -e s/'LABEL="cloudinit_hook"'/'KERNEL=="zd*", GOTO="cloudinit_end"\n&'/ "${FILE}"
- sudo udevadm control --reload-rules
- fi
- fi
- - name: Clear the kernel ring buffer
- run: |
- sudo dmesg -c >/var/tmp/dmesg-prerun
- - name: Reclaim and report disk space
- run: |
- ${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh
- df -h /
- - name: Tests
- run: |
- set -o pipefail
- /usr/share/zfs/zfs-tests.sh -vKR -s 3G | scripts/zfs-tests-color.sh
- shell: bash
- timeout-minutes: 330
- - name: Prepare artifacts
- if: failure()
- run: |
- RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
- sudo dmesg > $RESULTS_PATH/dmesg
- sudo cp /var/log/syslog /var/tmp/dmesg-prerun $RESULTS_PATH/
- sudo chmod +r $RESULTS_PATH/*
- # Replace ':' in dir names, actions/upload-artifact doesn't support it
- for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
- - uses: actions/upload-artifact@v3
- if: failure()
- with:
- name: Test logs Ubuntu-${{ matrix.os }}
- path: |
- /var/tmp/test_results/*
- !/var/tmp/test_results/current
- if-no-files-found: ignore
diff --git a/sys/contrib/openzfs/.github/workflows/zfs-tests-sanity.yml b/sys/contrib/openzfs/.github/workflows/zfs-tests-sanity.yml
deleted file mode 100644
index bab8aa175a8..00000000000
--- a/sys/contrib/openzfs/.github/workflows/zfs-tests-sanity.yml
+++ /dev/null
@@ -1,80 +0,0 @@
-name: zfs-tests-sanity
-
-on:
- push:
- pull_request:
-
-jobs:
- tests:
- runs-on: ubuntu-22.04
- steps:
- - uses: actions/checkout@v3
- with:
- ref: ${{ github.event.pull_request.head.sha }}
- - name: Install dependencies
- run: |
- sudo apt-get update
- sudo apt-get -qq upgrade
- sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt apt-get install -qq
- sudo apt-get clean
- - name: Autogen.sh
- run: |
- ./autogen.sh
- - name: Configure
- run: |
- ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan
- - name: Make
- run: |
- make --no-print-directory --silent native-deb-utils native-deb-kmod
- mv ../*.deb .
- rm ./openzfs-zfs-dkms*.deb ./openzfs-zfs-dracut*.deb
- - name: Install
- run: |
- # Update order of directories to search for modules, otherwise
- # Ubuntu will load kernel-shipped ones.
- sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
- sudo dpkg -i *.deb
- # Native Debian packages enable and start the services
- # Stop zfs-zed daemon, as it may interfere with some ZTS test cases
- sudo systemctl stop zfs-zed
- # Workaround for cloud-init bug
- # see https://github.com/openzfs/zfs/issues/12644
- FILE=/lib/udev/rules.d/10-cloud-init-hook-hotplug.rules
- if [ -r "${FILE}" ]; then
- HASH=$(md5sum "${FILE}" | awk '{ print $1 }')
- if [ "${HASH}" = "121ff0ef1936cd2ef65aec0458a35772" ]; then
- # Just shove a zd* exclusion right above the hotplug hook...
- sudo sed -i -e s/'LABEL="cloudinit_hook"'/'KERNEL=="zd*", GOTO="cloudinit_end"\n&'/ "${FILE}"
- sudo udevadm control --reload-rules
- fi
- fi
- - name: Clear the kernel ring buffer
- run: |
- sudo dmesg -c >/var/tmp/dmesg-prerun
- - name: Reclaim and report disk space
- run: |
- ${{ github.workspace }}/.github/workflows/scripts/reclaim_disk_space.sh
- df -h /
- - name: Tests
- run: |
- set -o pipefail
- /usr/share/zfs/zfs-tests.sh -vKR -s 3G -r sanity | scripts/zfs-tests-color.sh
- shell: bash
- timeout-minutes: 330
- - name: Prepare artifacts
- if: failure()
- run: |
- RESULTS_PATH=$(readlink -f /var/tmp/test_results/current)
- sudo dmesg > $RESULTS_PATH/dmesg
- sudo cp /var/log/syslog /var/tmp/dmesg-prerun $RESULTS_PATH/
- sudo chmod +r $RESULTS_PATH/*
- # Replace ':' in dir names, actions/upload-artifact doesn't support it
- for f in $(find /var/tmp/test_results -name '*:*'); do mv "$f" "${f//:/__}"; done
- - uses: actions/upload-artifact@v3
- if: failure()
- with:
- name: Test logs Ubuntu-${{ matrix.os }}
- path: |
- /var/tmp/test_results/*
- !/var/tmp/test_results/current
- if-no-files-found: ignore
diff --git a/sys/contrib/openzfs/.github/workflows/zloop.yml b/sys/contrib/openzfs/.github/workflows/zloop.yml
deleted file mode 100644
index 1a234ac9940..00000000000
--- a/sys/contrib/openzfs/.github/workflows/zloop.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-name: zloop
-
-on:
- push:
- pull_request:
-
-jobs:
- tests:
- runs-on: ubuntu-22.04
- env:
- TEST_DIR: /var/tmp/zloop
- steps:
- - uses: actions/checkout@v3
- with:
- ref: ${{ github.event.pull_request.head.sha }}
- - name: Install dependencies
- run: |
- sudo apt-get update
- sudo apt-get -qq upgrade
- sudo xargs --arg-file=${{ github.workspace }}/.github/workflows/build-dependencies.txt apt-get install -qq
- sudo apt-get clean
- - name: Autogen.sh
- run: |
- ./autogen.sh
- - name: Configure
- run: |
- ./configure --enable-debug --enable-debuginfo --enable-asan --enable-ubsan
- - name: Make
- run: |
- make -j$(nproc) --no-print-directory --silent pkg-utils pkg-kmod
- - name: Install
- run: |
- sudo dpkg -i *.deb
- # Update order of directories to search for modules, otherwise
- # Ubuntu will load kernel-shipped ones.
- sudo sed -i.bak 's/updates/extra updates/' /etc/depmod.d/ubuntu.conf
- sudo depmod
- sudo modprobe zfs
- - name: Tests
- run: |
- sudo mkdir -p $TEST_DIR
- # run for 10 minutes or at most 2 iterations for a maximum runner
- # time of 20 minutes.
- sudo /usr/share/zfs/zloop.sh -t 600 -I 2 -l -m1 -- -T 120 -P 60
- - name: Prepare artifacts
- if: failure()
- run: |
- sudo chmod +r -R $TEST_DIR/
- - uses: actions/upload-artifact@v3
- if: failure()
- with:
- name: Logs
- path: |
- /var/tmp/zloop/*/
- !/var/tmp/zloop/*/vdev/
- if-no-files-found: ignore
- - uses: actions/upload-artifact@v3
- if: failure()
- with:
- name: Pool files
- path: |
- /var/tmp/zloop/*/vdev/
- if-no-files-found: ignore
diff --git a/sys/contrib/openzfs/cmd/arc_summary b/sys/contrib/openzfs/cmd/arc_summary
index 7149629468e..5d10e903fcb 100755
--- a/sys/contrib/openzfs/cmd/arc_summary
+++ b/sys/contrib/openzfs/cmd/arc_summary
@@ -270,16 +270,14 @@ def draw_graph(kstats_dict):
arc_perc = f_perc(arc_stats['size'], arc_stats['c_max'])
mfu_size = f_bytes(arc_stats['mfu_size'])
mru_size = f_bytes(arc_stats['mru_size'])
- meta_limit = f_bytes(arc_stats['arc_meta_limit'])
meta_size = f_bytes(arc_stats['arc_meta_used'])
dnode_limit = f_bytes(arc_stats['arc_dnode_limit'])
dnode_size = f_bytes(arc_stats['dnode_size'])
- info_form = ('ARC: {0} ({1}) MFU: {2} MRU: {3} META: {4} ({5}) '
- 'DNODE {6} ({7})')
+ info_form = ('ARC: {0} ({1}) MFU: {2} MRU: {3} META: {4} '
+ 'DNODE {5} ({6})')
info_line = info_form.format(arc_size, arc_perc, mfu_size, mru_size,
- meta_size, meta_limit, dnode_size,
- dnode_limit)
+ meta_size, dnode_size, dnode_limit)
info_spc = ' '*int((GRAPH_WIDTH-len(info_line))/2)
info_line = GRAPH_INDENT+info_spc+info_line
@@ -558,16 +556,28 @@ def section_arc(kstats_dict):
arc_target_size = arc_stats['c']
arc_max = arc_stats['c_max']
arc_min = arc_stats['c_min']
- anon_size = arc_stats['anon_size']
- mfu_size = arc_stats['mfu_size']
- mru_size = arc_stats['mru_size']
- mfug_size = arc_stats['mfu_ghost_size']
- mrug_size = arc_stats['mru_ghost_size']
- unc_size = arc_stats['uncached_size']
- meta_limit = arc_stats['arc_meta_limit']
- meta_size = arc_stats['arc_meta_used']
+ meta = arc_stats['meta']
+ pd = arc_stats['pd']
+ pm = arc_stats['pm']
+ anon_data = arc_stats['anon_data']
+ anon_metadata = arc_stats['anon_metadata']
+ mfu_data = arc_stats['mfu_data']
+ mfu_metadata = arc_stats['mfu_metadata']
+ mru_data = arc_stats['mru_data']
+ mru_metadata = arc_stats['mru_metadata']
+ mfug_data = arc_stats['mfu_ghost_data']
+ mfug_metadata = arc_stats['mfu_ghost_metadata']
+ mrug_data = arc_stats['mru_ghost_data']
+ mrug_metadata = arc_stats['mru_ghost_metadata']
+ unc_data = arc_stats['uncached_data']
+ unc_metadata = arc_stats['uncached_metadata']
+ bonus_size = arc_stats['bonus_size']
dnode_limit = arc_stats['arc_dnode_limit']
dnode_size = arc_stats['dnode_size']
+ dbuf_size = arc_stats['dbuf_size']
+ hdr_size = arc_stats['hdr_size']
+ l2_hdr_size = arc_stats['l2_hdr_size']
+ abd_chunk_waste_size = arc_stats['abd_chunk_waste_size']
target_size_ratio = '{0}:1'.format(int(arc_max) // int(arc_min))
prt_2('ARC size (current):',
@@ -578,25 +588,56 @@ def section_arc(kstats_dict):
f_perc(arc_min, arc_max), f_bytes(arc_min))
prt_i2('Max size (high water):',
target_size_ratio, f_bytes(arc_max))
- caches_size = int(anon_size)+int(mfu_size)+int(mru_size)+int(unc_size)
- prt_i2('Anonymouns data size:',
- f_perc(anon_size, caches_size), f_bytes(anon_size))
- prt_i2('Most Frequently Used (MFU) cache size:',
- f_perc(mfu_size, caches_size), f_bytes(mfu_size))
- prt_i2('Most Recently Used (MRU) cache size:',
- f_perc(mru_size, caches_size), f_bytes(mru_size))
- prt_i1('Most Frequently Used (MFU) ghost size:', f_bytes(mfug_size))
- prt_i1('Most Recently Used (MRU) ghost size:', f_bytes(mrug_size))
+ caches_size = int(anon_data)+int(anon_metadata)+\
+ int(mfu_data)+int(mfu_metadata)+int(mru_data)+int(mru_metadata)+\
+ int(unc_data)+int(unc_metadata)
+ prt_i2('Anonymous data size:',
+ f_perc(anon_data, caches_size), f_bytes(anon_data))
+ prt_i2('Anonymous metadata size:',
+ f_perc(anon_metadata, caches_size), f_bytes(anon_metadata))
+ s = 4294967296
+ v = (s-int(pd))*(s-int(meta))/s
+ prt_i2('MFU data target:', f_perc(v, s),
+ f_bytes(v / 65536 * caches_size / 65536))
+ prt_i2('MFU data size:',
+ f_perc(mfu_data, caches_size), f_bytes(mfu_data))
+ prt_i1('MFU ghost data size:', f_bytes(mfug_data))
+ v = (s-int(pm))*int(meta)/s
+ prt_i2('MFU metadata target:', f_perc(v, s),
+ f_bytes(v / 65536 * caches_size / 65536))
+ prt_i2('MFU metadata size:',
+ f_perc(mfu_metadata, caches_size), f_bytes(mfu_metadata))
+ prt_i1('MFU ghost metadata size:', f_bytes(mfug_metadata))
+ v = int(pd)*(s-int(meta))/s
+ prt_i2('MRU data target:', f_perc(v, s),
+ f_bytes(v / 65536 * caches_size / 65536))
+ prt_i2('MRU data size:',
+ f_perc(mru_data, caches_size), f_bytes(mru_data))
+ prt_i1('MRU ghost data size:', f_bytes(mrug_data))
+ v = int(pm)*int(meta)/s
+ prt_i2('MRU metadata target:', f_perc(v, s),
+ f_bytes(v / 65536 * caches_size / 65536))
+ prt_i2('MRU metadata size:',
+ f_perc(mru_metadata, caches_size), f_bytes(mru_metadata))
+ prt_i1('MRU ghost metadata size:', f_bytes(mrug_metadata))
prt_i2('Uncached data size:',
- f_perc(unc_size, caches_size), f_bytes(unc_size))
- prt_i2('Metadata cache size (hard limit):',
- f_perc(meta_limit, arc_max), f_bytes(meta_limit))
- prt_i2('Metadata cache size (current):',
- f_perc(meta_size, meta_limit), f_bytes(meta_size))
- prt_i2('Dnode cache size (hard limit):',
- f_perc(dnode_limit, meta_limit), f_bytes(dnode_limit))
- prt_i2('Dnode cache size (current):',
+ f_perc(unc_data, caches_size), f_bytes(unc_data))
+ prt_i2('Uncached metadata size:',
+ f_perc(unc_metadata, caches_size), f_bytes(unc_metadata))
+ prt_i2('Bonus size:',
+ f_perc(bonus_size, arc_size), f_bytes(bonus_size))
+ prt_i2('Dnode cache target:',
+ f_perc(dnode_limit, arc_max), f_bytes(dnode_limit))
+ prt_i2('Dnode cache size:',
f_perc(dnode_size, dnode_limit), f_bytes(dnode_size))
+ prt_i2('Dbuf size:',
+ f_perc(dbuf_size, arc_size), f_bytes(dbuf_size))
+ prt_i2('Header size:',
+ f_perc(hdr_size, arc_size), f_bytes(hdr_size))
+ prt_i2('L2 header size:',
+ f_perc(l2_hdr_size, arc_size), f_bytes(l2_hdr_size))
+ prt_i2('ABD chunk waste size:',
+ f_perc(abd_chunk_waste_size, arc_size), f_bytes(abd_chunk_waste_size))
print()
print('ARC hash breakdown:')
diff --git a/sys/contrib/openzfs/cmd/mount_zfs.c b/sys/contrib/openzfs/cmd/mount_zfs.c
index bc2d366bf25..fc922095064 100644
--- a/sys/contrib/openzfs/cmd/mount_zfs.c
+++ b/sys/contrib/openzfs/cmd/mount_zfs.c
@@ -74,7 +74,7 @@ parse_dataset(const char *target, char **dataset)
nvlist_t *cfg = NULL;
if (zpool_read_label(fd, &cfg, NULL) == 0) {
- char *nm = NULL;
+ const char *nm = NULL;
if (!nvlist_lookup_string(cfg, ZPOOL_CONFIG_POOL_NAME, &nm))
strlcpy(*dataset, nm, PATH_MAX);
nvlist_free(cfg);
diff --git a/sys/contrib/openzfs/cmd/zdb/Makefile.am b/sys/contrib/openzfs/cmd/zdb/Makefile.am
index b80f38b3fd5..c93c9c37cd8 100644
--- a/sys/contrib/openzfs/cmd/zdb/Makefile.am
+++ b/sys/contrib/openzfs/cmd/zdb/Makefile.am
@@ -1,4 +1,5 @@
zdb_CPPFLAGS = $(AM_CPPFLAGS) $(FORCEDEBUG_CPPFLAGS)
+zdb_CFLAGS = $(AM_CFLAGS) $(LIBCRYPTO_CFLAGS)
sbin_PROGRAMS += zdb
CPPCHECKTARGETS += zdb
@@ -12,3 +13,5 @@ zdb_LDADD = \
libzpool.la \
libzfs_core.la \
libnvpair.la
+
+zdb_LDADD += $(LIBCRYPTO_LIBS)
diff --git a/sys/contrib/openzfs/cmd/zdb/zdb.c b/sys/contrib/openzfs/cmd/zdb/zdb.c
index d239da67613..e87826f7467 100644
--- a/sys/contrib/openzfs/cmd/zdb/zdb.c
+++ b/sys/contrib/openzfs/cmd/zdb/zdb.c
@@ -40,6 +40,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -116,7 +117,6 @@ zdb_ot_name(dmu_object_type_t type)
extern int reference_tracking_enable;
extern int zfs_recover;
-extern unsigned long zfs_arc_meta_min, zfs_arc_meta_limit;
extern uint_t zfs_vdev_async_read_max_active;
extern boolean_t spa_load_verify_dryrun;
extern boolean_t spa_mode_readable_spacemaps;
@@ -785,16 +785,17 @@ usage(void)
"Usage:\t%s [-AbcdDFGhikLMPsvXy] [-e [-V] [-p ...]] "
"[-I ]\n"
"\t\t[-o =]... [-t ] [-U ] [-x ]\n"
+ "\t\t[-K ]\n"
"\t\t[[/] [