Skip to content

Commit

Permalink
disable EDONR on FreeBSD
Browse files Browse the repository at this point in the history
FreeBSD uses its own crypto framework in-kernel which, at this time,
has no EDONR implementation.

Signed-off-by: Matt Macy <mmacy@FreeBSD.org>
  • Loading branch information
mattmacy committed Dec 3, 2019
1 parent 5142032 commit beb0865
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/sys/zio.h
Expand Up @@ -85,7 +85,9 @@ enum zio_checksum {
ZIO_CHECKSUM_NOPARITY,
ZIO_CHECKSUM_SHA512,
ZIO_CHECKSUM_SKEIN,
#if !defined(__FreeBSD__) || !defined(_KERNEL)
ZIO_CHECKSUM_EDONR,
#endif
ZIO_CHECKSUM_FUNCTIONS
};

Expand Down
3 changes: 3 additions & 0 deletions module/zcommon/zfeature_common.c
Expand Up @@ -421,6 +421,8 @@ zpool_feature_init(void)
skein_deps);
}

#if !defined(__FreeBSD__) || !defined(_KERNEL)

{
static const spa_feature_t edonr_deps[] = {
SPA_FEATURE_EXTENSIBLE_DATASET,
Expand All @@ -432,6 +434,7 @@ zpool_feature_init(void)
ZFEATURE_FLAG_PER_DATASET, ZFEATURE_TYPE_BOOLEAN,
edonr_deps);
}
#endif

{
static const spa_feature_t redact_books_deps[] = {
Expand Down
6 changes: 6 additions & 0 deletions module/zcommon/zfs_prop.c
Expand Up @@ -81,7 +81,10 @@ zfs_prop_init(void)
{ "noparity", ZIO_CHECKSUM_NOPARITY },
{ "sha512", ZIO_CHECKSUM_SHA512 },
{ "skein", ZIO_CHECKSUM_SKEIN },
#if !defined(_KERNEL) || !defined(__FreeBSD__)

{ "edonr", ZIO_CHECKSUM_EDONR },
#endif
{ NULL }
};

Expand All @@ -98,8 +101,11 @@ zfs_prop_init(void)
{ "skein", ZIO_CHECKSUM_SKEIN },
{ "skein,verify",
ZIO_CHECKSUM_SKEIN | ZIO_CHECKSUM_VERIFY },
#if !defined(_KERNEL) || !defined(__FreeBSD__)

{ "edonr,verify",
ZIO_CHECKSUM_EDONR | ZIO_CHECKSUM_VERIFY },
#endif
{ NULL }
};

Expand Down
4 changes: 4 additions & 0 deletions module/zfs/zio_checksum.c
Expand Up @@ -191,10 +191,12 @@ zio_checksum_info_t zio_checksum_table[ZIO_CHECKSUM_FUNCTIONS] = {
abd_checksum_skein_tmpl_init, abd_checksum_skein_tmpl_free,
ZCHECKSUM_FLAG_METADATA | ZCHECKSUM_FLAG_DEDUP |
ZCHECKSUM_FLAG_SALTED | ZCHECKSUM_FLAG_NOPWRITE, "skein"},
#if !defined(_KERNEL) || !defined(__FreeBSD__)
{{abd_checksum_edonr_native, abd_checksum_edonr_byteswap},
abd_checksum_edonr_tmpl_init, abd_checksum_edonr_tmpl_free,
ZCHECKSUM_FLAG_METADATA | ZCHECKSUM_FLAG_SALTED |
ZCHECKSUM_FLAG_NOPWRITE, "edonr"},
#endif
};

/*
Expand All @@ -211,8 +213,10 @@ zio_checksum_to_feature(enum zio_checksum cksum)
return (SPA_FEATURE_SHA512);
case ZIO_CHECKSUM_SKEIN:
return (SPA_FEATURE_SKEIN);
#if !defined(_KERNEL) || !defined(__FreeBSD__)
case ZIO_CHECKSUM_EDONR:
return (SPA_FEATURE_EDONR);
#endif
default:
return (SPA_FEATURE_NONE);
}
Expand Down

0 comments on commit beb0865

Please sign in to comment.