diff --git a/stand/libsa/zfs/Makefile.inc b/stand/libsa/zfs/Makefile.inc --- a/stand/libsa/zfs/Makefile.inc +++ b/stand/libsa/zfs/Makefile.inc @@ -12,13 +12,11 @@ ZFS_SRC+= zfs_zstd.c ZFS_SRC+= blake3.c blake3_generic.c blake3_impl_hack.c ZSTD_SRC+= entropy_common.c error_private.c -ZSTD_SRC+= fse_compress.c fse_decompress.c hist.c -ZSTD_SRC+= huf_compress.c huf_decompress.c pool.c xxhash.c -ZSTD_SRC+= zstd_common.c zstd_compress.c zstd_compress_literals.c -ZSTD_SRC+= zstd_compress_sequences.c zstd_compress_superblock.c +ZSTD_SRC+= fse_decompress.c hist.c +ZSTD_SRC+= huf_decompress.c pool.c xxhash.c +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 -ZSTD_SRC+= zstd_opt.c SRCS+= ${ZFS_SRC} ${ZSTD_SRC} diff --git a/sys/contrib/openzfs/module/zstd/zfs_zstd.c b/sys/contrib/openzfs/module/zstd/zfs_zstd.c --- a/sys/contrib/openzfs/module/zstd/zfs_zstd.c +++ b/sys/contrib/openzfs/module/zstd/zfs_zstd.c @@ -182,16 +182,20 @@ * * The ZSTD handlers were split up for the most simplified implementation. */ +#ifndef IN_LIBSA static void *zstd_alloc(void *opaque, size_t size); +#endif static void *zstd_dctx_alloc(void *opaque, size_t size); static void zstd_free(void *opaque, void *ptr); +#ifndef IN_LIBSA /* Compression memory handler */ static const ZSTD_customMem zstd_malloc = { zstd_alloc, zstd_free, NULL, }; +#endif /* Decompression memory handler */ static const ZSTD_customMem zstd_dctx_malloc = { @@ -489,7 +493,6 @@ return (zfs_zstd_compress(s_start, d_start, s_len, d_len, level)); } -#endif /* Compress block using zstd */ size_t @@ -596,6 +599,7 @@ return (c_len + sizeof (*hdr)); } +#endif /* Decompress block using zstd and return its stored level */ int @@ -683,6 +687,7 @@ NULL)); } +#ifndef IN_LIBSA /* Allocator for zstd compression context using mempool_allocator */ static void * zstd_alloc(void *opaque __maybe_unused, size_t size) @@ -699,6 +704,7 @@ return ((void*)z + (sizeof (struct zstd_kmem))); } +#endif /* * Allocator for zstd decompression context using mempool_allocator with