From 79822b6b171cc2af23c6f3cd1608c59e15897a84 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Wed, 17 Nov 2010 20:30:14 +0100 Subject: [PATCH] Start adding DeltaSeq --- bacula/src/cats/cats.h | 1 + bacula/src/dird/catreq.c | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/bacula/src/cats/cats.h b/bacula/src/cats/cats.h index f0767ea507..5d7eb720a0 100644 --- a/bacula/src/cats/cats.h +++ b/bacula/src/cats/cats.h @@ -926,6 +926,7 @@ struct ATTR_DBR { uint32_t FileIndex; uint32_t Stream; uint32_t FileType; + uint32_t DeltaSeq; JobId_t JobId; DBId_t ClientId; DBId_t PathId; diff --git a/bacula/src/dird/catreq.c b/bacula/src/dird/catreq.c index 910cc57d5e..db195635de 100644 --- a/bacula/src/dird/catreq.c +++ b/bacula/src/dird/catreq.c @@ -418,6 +418,7 @@ static void update_attribute(JCR *jcr, char *msg, int32_t msglen) * Encoded attributes * Link name (if type==FT_LNK or FT_LNKSAVED) * Encoded extended-attributes (for Win32) + * Delta sequence number (32 bit int) * * Restore Object * File_index @@ -447,14 +448,26 @@ static void update_attribute(JCR *jcr, char *msg, int32_t msglen) jcr->attr = check_pool_memory_size(jcr->attr, msglen); memcpy(jcr->attr, msg, msglen); p = jcr->attr - msg + p; /* point p into jcr->attr */ - skip_nonspaces(&p); /* skip FileIndex */ + skip_nonspaces(&p); /* skip FileIndex */ skip_spaces(&p); ar->FileType = str_to_int32(p); - skip_nonspaces(&p); /* skip FileType */ + skip_nonspaces(&p); /* skip FileType */ skip_spaces(&p); fname = p; len = strlen(fname); /* length before attributes */ attr = &fname[len+1]; + ar->DeltaSeq = 0; + if (ar->FileType == FT_REG) { + p = attr + strlen(attr) + 1; /* point to link */ + p = p + strlen(p) + 1; /* point to extended attributes */ + p = p + strlen(p) + 1; /* point to delta sequence */ + /* + * Older FDs don't have a delta sequence, so check if it is there + */ + if (p - jcr->attr < msglen) { + ar->DeltaSeq = str_to_int32(p); + } + } Dmsg2(400, "dird