From: Alain Spineux Date: Mon, 14 Aug 2023 09:13:50 +0000 (+0200) Subject: Set default ZSTD level to 3 instead of 10 X-Git-Tag: Beta-15.0.0~135 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1037724076583d6b22860c54b150c5ffa4d47b74;p=thirdparty%2Fbacula.git Set default ZSTD level to 3 instead of 10 - add new zstd3 level - zstd is now an alias for zstd3 instead of zstd10 - 3 is a better compromise between compression and speed - 10 is way slower than level 3 - WARNING this break compatibility with previous version ! - the DIR now use a new CODE for zstd10 that is unknown for older FD - if you use zstd10 in your FileSet, you MUST upgrade your FD or change zstd10 to another level, zstd3 is probably the best choice --- diff --git a/bacula/src/dird/inc_conf.c b/bacula/src/dird/inc_conf.c index d6d28c2ad..35fa2fcea 100644 --- a/bacula/src/dird/inc_conf.c +++ b/bacula/src/dird/inc_conf.c @@ -206,8 +206,9 @@ struct s_fs_opt FS_options[] = { {"Gzip9", INC_KW_COMPRESSION, "Z9"}, {"Lzo", INC_KW_COMPRESSION, "Zo"}, {"zstd", INC_KW_COMPRESSION, "Zs"}, + {"zstd3", INC_KW_COMPRESSION, "Zs"}, {"zstd1", INC_KW_COMPRESSION, "Zr"}, - {"zstd10", INC_KW_COMPRESSION, "Zs"}, + {"zstd10", INC_KW_COMPRESSION, "Zu"}, {"zstd19", INC_KW_COMPRESSION, "Zt"}, {"blowfish", INC_KW_ENCRYPTION, "B"}, /* ***FIXME*** not implemented */ {"3des", INC_KW_ENCRYPTION, "3"}, /* ***FIXME*** not implemented */ diff --git a/bacula/src/filed/job.c b/bacula/src/filed/job.c index c0d9f3db3..0fda15eff 100644 --- a/bacula/src/filed/job.c +++ b/bacula/src/filed/job.c @@ -2084,10 +2084,13 @@ static int set_options(findFOPTS *fo, const char *opts) fo->Compress_algo = COMPRESS_LZO1X; fo->Compress_level = 1; /* not used with LZO */ } - else if (*p >= 'r' && *p <= 't') { + else if (*p >= 'r' && *p <= 'u') { fo->flags |= FO_COMPRESS; fo->Compress_algo = COMPRESS_ZSTD; switch(*p) { + case 'u': + fo->Compress_level = 10; + break; case 'r': fo->Compress_level = 1; break; @@ -2096,7 +2099,7 @@ static int set_options(findFOPTS *fo, const char *opts) break; case 's': default: - fo->Compress_level = 10; + fo->Compress_level = 3; break; } } else {