From: Kern Sibbald Date: Wed, 17 Nov 2010 19:30:14 +0000 (+0100) Subject: Start adding DeltaSeq X-Git-Tag: Release-7.0.0~1399 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=79822b6b171cc2af23c6f3cd1608c59e15897a84;p=bacula%2Fbacula Start adding DeltaSeq --- 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