]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
BEE Backport bacula/src/stored/aligned_dev.h
authorAlain Spineux <alain@baculasystems.com>
Tue, 12 May 2020 16:35:59 +0000 (18:35 +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: Eric Bollengier <eric@baculasystems.com>
Date:   Fri Jan 25 18:02:15 2019 +0100

    aligned: Fix #4547 about orphan file descriptors after the truncate command

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:   Tue Oct 10 14:07:58 2017 +0200

    BIG backport of the devices from Community 9.0

Author: Kern Sibbald <kern@sibbald.com>
Date:   Sun Feb 9 12:43:16 2014 +0100

    Define classes for most device types

bacula/src/stored/aligned_dev.h

index 81d06fdd9516be2fc499aa4a1e525da7fd768177..c550469e9201f7bdb6e12ec1a10abdd5af9c87ac 100644 (file)
@@ -29,6 +29,8 @@ public:
    aligned_dev();
    ~aligned_dev();
 
+   aligned_dev *paired_dev;                /* Paired meta data or aligned data device */
+
    boffset_t get_adata_size(DCR *dcr);
    boffset_t align_adata_addr(DCR *dcr, boffset_t addr);
    boffset_t get_adata_addr(DCR *dcr);
@@ -58,7 +60,8 @@ public:
    void clear_nospace();
    void clear_append();
    void clear_read();
-   void device_specific_init(JCR *jcr, DEVRES *device);
+   int device_specific_init(JCR *jcr, DEVRES *device);
+   int device_specific_close(DCR *dcr);
    int d_close(int fd);
    int d_open(const char *pathname, int flags);
    int d_ioctl(int fd, ioctl_req_t request, char *mt_com);
@@ -91,7 +94,7 @@ public:
    void write_adata(DCR *dcr, DEV_RECORD *rec);
    void write_cont_adata(DCR *dcr, DEV_RECORD *rec);
    int  write_adata_rechdr(DCR *dcr, DEV_RECORD *rec);
-   bool read_adata_record_header(DCR *dcr, DEV_BLOCK *block, DEV_RECORD *rec);
+   bool read_adata_record_header(DCR *dcr, DEV_BLOCK *block, DEV_RECORD *rec, bool *firstcall);
    void read_adata_block_header(DCR *dcr);
    int read_adata(DCR *dcr, DEV_RECORD *rec);
    bool have_adata_header(DCR *dcr, DEV_RECORD *rec, int32_t  FileIndex,