]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport bacula/src/stored/record.h
authorEric Bollengier <eric@baculasystems.com>
Tue, 12 May 2020 17:18:57 +0000 (19:18 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 29 Apr 2021 08:44:18 +0000 (10:44 +0200)
This commit is the result of the squash of the following main commits:

Author: Alain Spineux <alain@baculasystems.com>
Date:   Thu Feb 21 13:17:07 2019 +0100

    typo

Author: Eric Bollengier <eric@baculasystems.com>
Date:   Fri Oct 19 21:13:24 2018 +0200

    aligned: Fix RecNum count with non standard data packet size

Author: Alain Spineux <alain@baculasystems.com>
Date:   Fri Sep 1 16:16:36 2017 +0200

    dedup: Store data rehydrated size in VolABytes media record

    - collect chunk size in rec.extra_byte in append.c
      then sum these size into block->extra_bytes in record_write.c
      and finally do the ccounting into the volume with a
      dev->updateVolCatExtraBytes(block->extra_bytes) in block.c
    - dev->updateVolCatExtraBytes() is a new method that do nothing
      except for dedup_dev object

bacula/src/stored/record.h

index d2cb38fab6f52eceeb085eed797c879046de52c0..c8232b1430dd7beecde2fa500b2f4422676222be 100644 (file)
@@ -43,16 +43,16 @@ enum {
 };
 
 enum rec_state {
-   st_none,                               /* No state */
-   st_header,                             /* Write header */
-   st_cont_header,                        /* Write continuation header */
-   st_data,                               /* Write data record */
-   st_adata_blkhdr,                       /* Adata block header */
-   st_adata_rechdr,                       /* Adata record header */
-   st_cont_adata_rechdr,                  /* Adata continuation rechdr */
-   st_adata,                              /* Write aligned data */
-   st_cont_adata,                         /* Write more aligned data */
-   st_adata_label                         /* Writing adata vol label */
+   st_none,                               /* No state */
+   st_header,                             /* Write header */
+   st_cont_header,                        /* Write continuation header */
+   st_data,                               /* Write data record */
+   st_adata_blkhdr,                       /* Adata block header */
+   st_adata_rechdr,                       /* Adata record header */
+   st_cont_adata_rechdr,                  /* Adata continuation rechdr */
+   st_adata,                              /* Write aligned data */
+   st_cont_adata,                         /* Write more aligned data */
+   st_adata_label                         /* Writing adata vol label */
 };
 
 
@@ -82,7 +82,7 @@ enum rec_state {
 #define REC_NO_MATCH         (1<<3)   /* No match on continuation data */
 #define REC_CONTINUATION     (1<<4)   /* Continuation record found */
 #define REC_ISTAPE           (1<<5)   /* Set if device is tape */
-#define REC_ADATA_EMPTY      (1<<6)   /* Not endough adata in block */
+#define REC_ADATA_EMPTY      (1<<6)   /* Not enough adata in block */
 #define REC_NO_SPLIT         (1<<7)   /* Do not split this record */
 
 #define is_partial_record(r) ((r)->state_bits & REC_PARTIAL_RECORD)
@@ -117,6 +117,7 @@ struct DEV_RECORD {
    uint32_t adata_remainder;          /* remaining adata bytes to read/write */
    uint32_t remlen;                   /* temp remainder bytes */
    uint32_t data_bytes;               /* data_bytes */
+   uint32_t extra_bytes;              /* the extra size that must be accounted in VolABytes */
    uint32_t state_bits;               /* state bits */
    uint32_t RecNum;                   /* Record number in the block */
    uint32_t BlockNumber;              /* Block number for this record (used in read_records()) */