1- # ZSTD -On-ZFS Library Manual
1+ # Zstd -On-ZFS Library Manual
22
33## Introduction
44
5- This subtree contains the ZSTD library used in ZFS. It is heavily cut-down by
5+ This subtree contains the Zstd library used in ZFS. It is heavily cut-down by
66dropping any unneeded files, and combined into a single file, but otherwise is
77intentionally unmodified. Please do not alter the file containing the zstd
8- library, besides upgrading to a newer ZSTD release.
8+ library, besides upgrading to a newer Zstd release.
99
1010Tree structure:
1111
@@ -14,25 +14,43 @@ Tree structure:
1414* ` zstd-in.c ` is our template file for generating the single-file library
1515* ` include/ ` : This directory contains supplemental includes for platform
1616 compatibility, which are not expected to be used by ZFS elsewhere in the
17- future. Thus we keep them private to ZSTD .
17+ future. Thus we keep them private to Zstd .
1818
19- ## Updating ZSTD
19+ ## Zstd update policy
2020
21- To update ZSTD the following steps need to be taken:
21+ Since the exact compressed byte stream may change between Zstd versions, updates
22+ should follow this policy:
2223
23- 1 . Grab the latest release of [ ZSTD] ( https://github.com/facebook/zstd/releases ) .
24+ 1 . Zstd may be updated, as needed, after a new .0 release is tagged.
25+ 2 . Critical patches may be applied up until the next release freeze,
26+ _ potentially_ even updating to a newer upstream version.
27+ 3 . The Zstd version will not be upgraded within a major release.
28+ 4 . Multiple Zstd versions are not supported concurrently within a release.
29+ 5 . The library import commit must be a clean, unmodified upstream import. Any
30+ OpenZFS-specific integration or local adjustments go into follow-up commits.
31+ 6 . Release notes should highlight Zstd updates and any expected impact (e.g.
32+ changes in compression ratio/performance, and differences in compressed byte
33+ streams which may affect deduplication or NOP writes).
34+
35+ ## Updating Zstd
36+
37+ To update Zstd the following steps need to be taken:
38+
39+ 1 . Grab the latest release of [ Zstd] ( https://github.com/facebook/zstd/releases ) .
24402 . Copy the files output by the following script to ` module/zstd/lib/ ` :
25- ` grep include [path to zstd]/contrib/single_file_libs/zstd-in.c | awk '{ print $2 }' `
41+ ```
42+ grep include [path to zstd]/build/single_file_libs/zstd-in.c | awk '{ print $2 }'
43+ ```
26443 . Remove debug.c, threading.c, and zstdmt_compress.c.
27454 . Update Makefiles with resulting file lists.
28- 5 . Follow symbol renaming notes in ` include/zstd_compat_wrapper.h `
46+ 5 . Follow symbol renaming notes in ` include/zstd_compat_wrapper.h ` .
2947
30- ## Altering ZSTD and breaking changes
48+ ## Altering Zstd and breaking changes
3149
32- If ZSTD made changes that break compatibility or you need to make breaking
33- changes to the way we handle ZSTD , it is required to maintain backwards
50+ If Zstd made changes that break compatibility or you need to make breaking
51+ changes to the way we handle Zstd , it is required to maintain backwards
3452compatibility.
3553
36- We already save the ZSTD version number within the block header to be used
54+ We already save the Zstd version number within the block header to be used
3755to add future compatibility checks and/or fixes. However, currently it is
3856not actually used in such a way.
0 commit comments