]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport bacula/src/findlib/match.c
authorKern Sibbald <kern@sibbald.com>
Mon, 20 Apr 2020 14:42:41 +0000 (16:42 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 29 Apr 2021 08:44:16 +0000 (10:44 +0200)
This commit is the result of the squash of the following main commits:

Author: Alain Spineux <alain@baculasystems.com>
Date:   Tue Aug 28 17:14:31 2018 +0200

    snapshot: maintain both paths instead of stripping and unstripping

    - snap_fname is the path inside the snapshot used for "system" operation
    - fname is the path from the FileSet used for display and for SD or DIR
      "computation"
    - when snapshot is not in used, both are equal

Author: Kern Sibbald <kern@sibbald.com>
Date:   Sun May 4 08:58:54 2014 +0200

    Fix dedup option scan bug

Author: Kern Sibbald <kern@sibbald.com>
Date:   Sat May 3 16:10:37 2014 +0200

    Add deduplication directives

Author: Laurent Papier <papier@tuxfan.net>
Date:   Wed May 18 23:25:30 2011 +0200

    Add LZO compression support in bacula-fd.

    Add new generic compressed streams This should make easier to
    add additional compression scheme

    Rename a few define, add an element containing compression algorithm
    in some data structures.

bacula/src/findlib/match.c

index 0649477a127e6314e86f352de95d82ec04c638ec..6fdc2962dea05611650204f7097594146bc7ad44 100644 (file)
@@ -66,7 +66,7 @@ match_files(JCR *jcr, FF_PKT *ff, int file_save(JCR *, FF_PKT *ff_pkt, bool))
       bstrncat(ff->VerifyOpts, inc->VerifyOpts, sizeof(ff->VerifyOpts));
       Dmsg1(100, "find_files: file=%s\n", inc->fname);
       if (!file_is_excluded(ff, inc->fname)) {
-         if (find_one_file(jcr, ff, file_save, inc->fname, (dev_t)-1, 1) ==0) {
+         if (find_one_file(jcr, ff, file_save, inc->fname, inc->fname, (dev_t)-1, 1) ==0) {
             return 0;                  /* error return */
          }
       }
@@ -191,6 +191,12 @@ void add_fname_to_include_list(FF_PKT *ff, int prefixed, const char *fname)
             }
             Dmsg2(200, "Compression alg=%d level=%d\n", inc->algo, inc->Compress_level);
             break;
+         case 'd':                 /* Deduplication 0=none 1=Global 2=Local */
+            rp++;                  /* Skip z */
+            if (*rp >= '0' && *rp <= '2') {
+               inc->Dedup_level = *rp - '0';
+            }
+            break;
          case 'K':
             inc->options |= FO_NOATIME;
             break;
@@ -305,6 +311,7 @@ struct s_included_file *get_next_included_file(FF_PKT *ff, struct s_included_fil
       ff->flags = inc->options;
       ff->Compress_algo = inc->algo;
       ff->Compress_level = inc->Compress_level;
+      ff->Dedup_level = inc->Dedup_level;
    }
    return inc;
 }