]> www.infradead.org Git - mtd-utils.git/commitdiff
mkfs.ubifs: remove ZSTD_CLEVEL_DEFAULT for backwards compatibillity
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Tue, 9 Jul 2019 10:22:30 +0000 (12:22 +0200)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Tue, 9 Jul 2019 10:34:04 +0000 (12:34 +0200)
Support for ZSTD compression has been added recently through the ZSTD
library, which is famously known for its incredibly well designed and
stable API.

This patch removes usage of ZSTD_CLEVEL_DEFAULT, which isn't exposed
in older versions of the ZSTD library, and replaces it with with the
constant parameter 0. According to the documentation this should then
use a reasonable default (which is defined internally).

Other possible approachs include defining ZSTD_CLEVEL_DEFAULT to 3
(the value it _currently_ has) if it isn't defined. This patch chooses
the approach of passing 0 since this seems to be encouraged by the
existing documentation.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
ubifs-utils/mkfs.ubifs/compr.c

index 62398357c53512bc9a7b16cf597de0ad34ac4539..9eade89ffcfb00d8abbf681fb69b4bccb4aa96ff 100644 (file)
@@ -120,8 +120,7 @@ static int zstd_compress(void *in_buf, size_t in_len, void *out_buf,
 {
        size_t ret;
 
-       ret = ZSTD_compressCCtx(zctx, out_buf, *out_len, in_buf, in_len,
-                               ZSTD_CLEVEL_DEFAULT);
+       ret = ZSTD_compressCCtx(zctx, out_buf, *out_len, in_buf, in_len, 0);
        if (ZSTD_isError(ret)) {
                errcnt += 1;
                return -1;