3 ms·
> Why isn't the implementation of the algorithm as simple as linking in the related library Because filesystems need to store compression metadata and compress
by microcolonel 6y ago
> Why isn't the implementation of the algorithm as simple as linking in the related library
Because filesystems need to store compression metadata and compressor settings differently than individual archive streams do. Because of the way ZFS stores configuration like this, in the previous version of these patches, they had to choose a subset of the available compression levels when adding zstd support.
Different compressors and decompressors also have different state sizes for different settings. Allocating, reusing, and discarding buffers for compression/decompression state in a sensible way inside an operating system kernel is not trivial.