]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Set default ZSTD level to 3 instead of 10
authorAlain Spineux <alain@baculasystems.com>
Mon, 14 Aug 2023 09:13:50 +0000 (11:13 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:02 +0000 (13:57 +0200)
- 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

bacula/src/dird/inc_conf.c
bacula/src/filed/job.c

index d6d28c2adfbc4bcb7049e11b0245859f21db9b57..35fa2fceae75a55c9e8802338292c85f4c9a28fe 100644 (file)
@@ -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 */
index c0d9f3db32f69f6fb4ba46055001b5ed170b95a3..0fda15effbc2c08db4b7e3abb21781824a0695e9 100644 (file)
@@ -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 {