he
> test.
>
> v2 -> v3:
> * (3/9) Silence warnings by Kernel Test Robot:
> https://github.com/facebook/zstd/pull/2324
> Stack size warnings remain, but these aren't new, and the functions it
> warns on
> are either unused or not in the maximum stack path. This patchset reduces
> zstd
> compression stack usage by 1 KB overall. I've gotten the low hanging fruit,
> and
> more stack reduction would require significant changes that have the
> potential
> to introduce new bugs. However, I do hope to continue to reduce zstd stack
> usage in future versions.
>
> v3 -> v4:
> * (3/9) Fix errors and warnings reported by Kernel Test Robot:
> https://github.com/facebook/zstd/pull/2326
> - Replace mem.h with a custom kernel implementation that matches the current
> lib/zstd/mem.h in the kernel. This avoids calls to __builtin_bswap*()
> which
> don't work on certain architectures, as exposed by the Kernel Test Robot.
> - Remove ASAN/MSAN (un)poisoning code which doesn't work in the kernel, as
> exposed by the Kernel Test Robot.
> - I've fixed all of the valid cppcheck warnings reported, but there were
> many
> false positives, where cppcheck was incorrectly analyzing the situation,
> which I did not fix. I don't believe it is reasonable to expect that
> upstream
> zstd silences all the static analyzer false positives. Upstream zstd uses
> clang scan-build for its static analysis. We find that supporting multiple
> static analysis tools multiplies the burden of silencing false positives,
> without providing enough marginal value over running a single static
> analysis
> tool.
>
> v4 -> v5:
> * Rebase onto v5.10-rc2
> * (6/9) Merge with other F2FS changes (no functional change in patch).
>
> v5 -> v6:
> * Rebase onto v5.10-rc6.
> * Switch to using a kernel style wrapper API as suggested by Cristoph.
>
> v6 -> v7:
> * Expose the upstream library header as `include/linux/zstd_lib.h`.
> Instead of creating new structs mirroring the upstream zstd structs
> use upstream's structs directly with a typedef to get a kernel style name.
> This removes the memcpy cruft.
> * (1/3) Undo ZSTD_WINDOWLOG_MAX and handle_zstd_error changes.
> * (3/3) Expose zstd_errors.h as `include/linux/zstd_errors.h` because it
> is needed by the kernel wrapper API.
>
> v7 -> v8:
> * (1/3) Fix typo in EXPORT_SYMBOL().
> * (1/3) Fix typo in zstd.h comments.
> * (3/3) Update to latest zstd release: 1.4.6 -> 1.4.10
> This includes ~1KB of stack space reductions.
>
> v8 -> v9:
> * (1/3) Rebase onto v5.12-rc5
> * (1/3) Add zstd_min_clevel() & zstd_max_clevel() and use in f2fs.
> Thanks to Oleksandr Natalenko for spotting it!
> * (1/3) Move lib/decompress_unzstd.c usage of ZSTD_getErrorCode()
> to zstd_get_error_code().
> * (1/3) Update modified zstd headers to yearless copyright.
> * (2/3) Add copyright/license header to decompress_sources.h for consistency.
> * (3/3) Update to yearless copyright for all zstd files. Thanks to
> Mike Dolan for spotting it!
>
> Nick Terrell (3):
> lib: zstd: Add kernel-specific API
> lib: zstd: Add decompress_sources.h for decompress_unzstd
> lib: zstd: Upgrade to latest upstream zstd version 1.4.10
>
> crypto/zstd.c | 28 +-
> fs/btrfs/zstd.c | 68 +-
> fs/f2fs/compress.c| 56 +-
> fs/f2fs/super.c |2 +-
> fs/pstore/platform.c |2 +-
> fs/squashfs/zstd_wrapper.c| 16 +-
> include/linux/zstd.h | 1252 +---
> include/linux/zstd_errors.h | 77 +
> include/linux/zstd_lib.h | 2432
> lib/decompress_unzstd.c | 48 +-
> lib/zstd/Makefile | 44 +-
> lib/zstd/bitstream.h | 380 --
> lib/zstd/common/bitstream.h | 437 ++
> lib/zstd/common/compiler.h| 151 +
> lib/zstd/common/cpu.h | 194 +
> lib/zstd/common/debug.c | 24 +
> lib/zstd/common/debug.h | 101 +
> lib/zstd/common/entropy_common.c | 357 ++
> lib/zstd/common/error_private.c | 56 +
> lib/zstd/common/error_private.h | 66 +
> lib/zstd/common/fse.h | 710 +++
> lib/zstd/common/fse_decompress.c | 390 ++
> lib/zstd/common/huf.h | 356 ++
> lib/zstd/common