int zstat;
if (ff_pkt->flags & FO_GZIP) {
- if (ff_pkt->flags & FO_SPARSE) {
+ if ((ff_pkt->flags & FO_SPARSE) || (ff_pkt->flags & FO_DELTA)) {
cbuf = (Bytef *)jcr->compress_buf + SPARSE_FADDR_SIZE;
max_compress_len = jcr->compress_buf_size - SPARSE_FADDR_SIZE;
} else {
* Make space at beginning of buffer for fileAddr because this
* same buffer will be used for writing if compression is off.
*/
- if (ff_pkt->flags & FO_SPARSE) {
+ if ((ff_pkt->flags & FO_SPARSE) || (ff_pkt->flags & FO_DELTA)) {
rbuf += SPARSE_FADDR_SIZE;
rsize -= SPARSE_FADDR_SIZE;
#ifdef HAVE_FREEBSD_OS
if (allZeros) {
continue; /* skip block of zeros */
}
+ } else if (ff_pkt->flags & FO_DELTA) {
+ ser_declare;
+ ser_begin(wbuf, SPARSE_FADDR_SIZE);
+ ser_uint64(ff_pkt->bfd.offset); /* store offset in begin of buffer */
}
jcr->ReadBytes += sd->msglen; /* count bytes read */
uint32_t initial_len = 0;
ser_declare;
- if (ff_pkt->flags & FO_SPARSE) {
+ if ((ff_pkt->flags & FO_SPARSE) || (ff_pkt->flags & FO_DELTA)) {
cipher_input_len += SPARSE_FADDR_SIZE;
}
}
/* Send the buffer to the Storage daemon */
- if (ff_pkt->flags & FO_SPARSE) {
+ if ((ff_pkt->flags & FO_SPARSE) || (ff_pkt->flags & FO_DELTA)) {
sd->msglen += SPARSE_FADDR_SIZE; /* include fileAddr in size */
}
sd->msg = wbuf; /* set correct write buffer */
free_and_null_pool_memory(ff_pkt->object);
}
break;
+ case FT_REG:
+ stat = sd->fsend("%ld %d %s%c%s%c%c%s%c%d%c", jcr->JobFiles,
+ ff_pkt->type, ff_pkt->fname, 0, attribs, 0, 0, attribsEx, 0,
+ ff_pkt->delta_seq, 0);
+ break;
default:
stat = sd->fsend("%ld %d %s%c%s%c%c%s%c%u%c", jcr->JobFiles,
ff_pkt->type, ff_pkt->fname, 0, attribs, 0, 0,
sp.pkt_size = sizeof(sp);
sp.pkt_end = sizeof(sp);
sp.portable = true;
+ sp.flags = 0;
sp.cmd = cmd;
Dmsg3(dbglvl, "startBackup st_size=%p st_blocks=%p sp=%p\n", &sp.statp.st_size, &sp.statp.st_blocks,
&sp);
pm_strcpy(link, sp.link);
ff_pkt->fname = fname.c_str();
ff_pkt->link = link.c_str();
+ if (sp.flags & FO_DELTA) {
+ ff_pkt->flags |= FO_DELTA;
+ } else {
+ ff_pkt->flags &= ~FO_DELTA;
+ }
}
memcpy(&ff_pkt->statp, &sp.statp, sizeof(ff_pkt->statp));
continue;
}
goto bail_out;
- }
+ } /* end while loop */
goto bail_out;
- }
+ } /* end loop over all plugins */
Jmsg1(jcr, M_FATAL, 0, "Command plugin \"%s\" not found.\n", cmd);
bail_out:
uint32_t flags; /* Bacula internal flags */
bool portable; /* set if data format is portable */
char *cmd; /* command */
+ uint32_t delta_seq; /* Delta sequence number */
char *object_name; /* Object name to create */
char *object; /* restore object data to save */
int32_t object_len; /* restore object length */
Dmsg2(130, "Encryption writing full block, %u bytes, remaining %u bytes in buffer\n", wsize, cipher_ctx->buf_len);
}
- if (flags & FO_SPARSE) {
+ if ((flags & FO_SPARSE) || (flags & FO_DELTA)) {
if (!sparse_data(jcr, bfd, addr, &wbuf, &wsize)) {
goto bail_out;
}
cipher_ctx->buf_len -= cipher_ctx->packet_len;
Dmsg2(130, "Encryption writing full block, %u bytes, remaining %u bytes in buffer\n", wsize, cipher_ctx->buf_len);
- if (flags & FO_SPARSE) {
+ if ((flags & FO_SPARSE) || (flags & FO_DELTA)) {
if (!sparse_data(jcr, bfd, addr, &wbuf, &wsize)) {
return false;
}
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2003-2008 Free Software Foundation Europe e.V.
+ Copyright (C) 2003-2010 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
DWORD rw_bytes; /* Bytes read or written */
DWORD lerror; /* Last error code */
int berrno; /* errno */
+ bofset_t offset; /* Delta offset */
JCR *jcr; /* jcr for editing job codes */
PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT win32DecompContext; /* context for decomposition of win32 backup streams */
int use_backup_decomp; /* set if using BackupRead Stream Decomposition */
int m_flags; /* open flags */
int berrno; /* errno */
int32_t lerror; /* not used - simplies Win32 builds */
+ boffset_t offset; /* Delta offset */
JCR *jcr; /* jcr for editing job codes */
PROCESS_WIN32_BACKUPAPIBLOCK_CONTEXT win32DecompContext; /* context for decomposition of win32 backup streams */
int use_backup_decomp; /* set if using BackupRead Stream Decomposition */
#define FO_STRIPPATH (1<<25) /* Check for stripping path */
#define FO_HONOR_NODUMP (1<<26) /* honor NODUMP flag */
#define FO_XATTR (1<<27) /* Backup Extended Attributes */
+#define FO_DELTA (1<<28) /* Do delta on file */
struct s_included_file {
struct s_included_file *next;
int32_t object_index; /* Object index */
int32_t object_len; /* Object length */
int32_t object_compression; /* Type of compression for object */
+ uint32_t delta_seq; /* Delta sequence number */
struct f_link *linked; /* Set if this file is hard linked */
int type; /* FT_ type from above */
int ff_errno; /* errno */