void select_data_stream(DCR *dcr, DEV_RECORD *rec);
bool flush_block(DCR *dcr);
bool do_pre_write_checks(DCR *dcr, DEV_RECORD *rec);
-
-
-
+ bool get_os_device_freespace();
+ bool is_fs_nearly_full(uint64_t threshold);
+ int rehydrate_record(DCR *dcr, DEV_RECORD *rec);
/*
* Locking and blocking calls
*/
if (read_dedup_data) {
Dmsg0(DT_DEDUP|215, "Initialize dedup interface\n");
jcr->read_dcr->dev->setup_dedup_rehydration_interface(jcr->read_dcr);
+
+ } else {
+ dev->set_delay_adata(); /* Do not read aligned data */
}
} else {
if (!first_open_device(dcr)) {
bool m_shstore_user_lock; /* set if user set shared lock */
bool m_shstore_register; /* set if register key set */
bool m_shstore_blocked; /* Set if I am blocked */
+ bool m_delay_adata; /* Set if we need to ask to read adata */
bool adata; /* set if adata device */
int label_type; /* Bacula/ANSI/IBM label types */
uint32_t drive_index; /* Autochanger drive index (base 0) */
void set_load() { m_load = true; };
void set_wait() { m_wait = true; };
void clear_wait() { m_wait = false; };
+ void set_delay_adata() { m_delay_adata = true;};
+ void clear_delay_adata() { m_delay_adata = false;};
bool must_wait() const { return m_wait; };
void inc_reserved() { m_num_reserved++; }
void set_mounted(int val) { if (val) state |= ST_MOUNTED; \
/* Virtual functions that can be overridden */
- virtual void set_file_size(uint64_t val) { file_size = val;};
- virtual uint64_t update_file_size(uint64_t add) { file_size += add; return file_size; };
virtual void setVolCatName(const char *name);
virtual void setVolCatStatus(const char *status);
virtual void free_dcr_blocks(DCR *dcr); /* in block_util.c */
void open_tape_device(DCR *dcr, int omode); /* in dev.c */
void open_file_device(DCR *dcr, int omode); /* in dev.c */
+ virtual int rehydrate_record(DCR *dcr, DEV_RECORD *rec) { return 1;};
virtual bool setup_dedup_rehydration_interface(DCR *dcr) { return false; };
virtual void free_dedup_rehydration_interface(DCR *dcr) { };
virtual GetMsg *get_msg_queue(JCR *jcr, BSOCK *sock, int32_t bufsize)
int Copy; /* identical copy number */
int Stripe; /* RAIT stripe */
VOLUME_CAT_INFO VolCatInfo; /* Catalog info for desired volume */
+ /* *** BEEF *** */
uint32_t crc32(unsigned char *buf, int len, uint32_t expected_crc);
/* *** SIR *** */
st_cont_adata_rechdr, /* 6 Adata continuation rechdr */
st_adata, /* 7 Write aligned data */
st_cont_adata, /* 8 Write more aligned data */
- st_adata_label /* 9 Writing adata vol label */
+ st_adata_label, /* 9 Writing adata vol label */
+ st_header_only /* 10 Read only the header (aligned) */
};
/* Imported subroutines */
static const int read_dbglvl = 200|DT_VOLUME;
-static const int dbgep = 400|DT_VOLUME; /* debug execution path */
+static const int dbgep = 200|DT_VOLUME; /* debug execution path */
/*
* Read the header record
if (dcr->dev->have_adata_header(dcr, rec, FileIndex, Stream, VolSessionId)) {
return true;
}
+
block->bufp += rhl;
block->binbuf -= rhl;
rec->remlen -= rhl;
Dmsg0(dbgep, "=== rpath 1 Enter read_record_from block\n");
- /* We return from a previous call with aligned volume, we did not read
- * the data on disk, let's read the next ameta record.
- */
- if (rec->rstate == st_header_only) {
- rec->remainder = 0;
- rec->rstate = st_header;
- }
/* Update the Record number only if we have a new record */
if (rec->remainder == 0) {
rec->RecNum = dcr->block->RecNum;
/* We read the next record */
dcr->block->RecNum++;
-
+
for ( ;; ) {
switch (rec->rstate) {
case st_none:
continue;
case st_header_only:
- /* We come from the st_cont_adata_rechdr state and we may read
- * or not the data associated
- */
Dmsg0(dbgep, "=== rpath 37 st_header_only\n");
+ rec->rstate = st_header;
goto get_out;
case st_data: