]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Cleanup director VolParam struct
authorEric Bollengier <eric@eb.homelinux.org>
Fri, 19 Dec 2008 20:53:05 +0000 (20:53 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Fri, 19 Dec 2008 20:53:05 +0000 (20:53 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8195 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/cats/cats.h
bacula/src/cats/sql_get.c
bacula/src/dird/backup.c
bacula/src/dird/bsr.c
bacula/src/stored/match_bsr.c
bacula/src/stored/parse_bsr.c
bacula/technotes-2.5

index 563503652cb7a4af15e161c0ccc59316a87d2885..60c470876fa3101cadbefdb7079d7dac1cf76b15 100644 (file)
@@ -839,10 +839,6 @@ struct VOL_PARAMS {
    uint32_t VolIndex;                 /* Volume seqence no. */
    uint32_t FirstIndex;               /* First index this Volume */
    uint32_t LastIndex;                /* Last index this Volume */
-   uint32_t StartFile;                /* File for start of data */
-   uint32_t EndFile;                  /* End file on Volume */
-   uint32_t StartBlock;               /* start block on tape */
-   uint32_t EndBlock;                 /* last block */
    int32_t Slot;                      /* Slot */
    uint64_t StartAddr;                /* Start address */
    uint64_t EndAddr;                  /* End address */
index 16e28644ecb4e21b5919a111d0c130f39286134b..31794f4900c213ed63e6e67099d151f87dde2b95 100644 (file)
@@ -455,16 +455,17 @@ int db_get_job_volume_parameters(JCR *jcr, B_DB *mdb, JobId_t JobId, VOL_PARAMS
                break;
             } else {
                DBId_t StorageId;
+               uint32_t StartBlock, EndBlock, StartFile, EndFile;
                bstrncpy(Vols[i].VolumeName, row[0], MAX_NAME_LENGTH);
                bstrncpy(Vols[i].MediaType, row[1], MAX_NAME_LENGTH);
                Vols[i].FirstIndex = str_to_uint64(row[2]);
                Vols[i].LastIndex = str_to_uint64(row[3]);
-               Vols[i].StartFile = str_to_uint64(row[4]);
-               Vols[i].EndFile = str_to_uint64(row[5]);
-               Vols[i].StartBlock = str_to_uint64(row[6]);
-               Vols[i].EndBlock = str_to_uint64(row[7]);
-               Vols[i].StartAddr = (((uint64_t)Vols[i].StartFile)<<32) | Vols[i].StartBlock;
-               Vols[i].EndAddr =   (((uint64_t)Vols[i].EndFile)<<32) | Vols[i].EndBlock;
+               StartFile = str_to_uint64(row[4]);
+               EndFile = str_to_uint64(row[5]);
+               StartBlock = str_to_uint64(row[6]);
+               EndBlock = str_to_uint64(row[7]);
+               Vols[i].StartAddr = (((uint64_t)StartFile)<<32) | StartBlock;
+               Vols[i].EndAddr =   (((uint64_t)EndFile)<<32) | EndBlock;
 //             Vols[i].Copy = str_to_uint64(row[8]);
                Vols[i].Slot = str_to_uint64(row[9]);
                StorageId = str_to_uint64(row[10]);
index 18286b5f7dc695ff3201a499a463990cda78030b..ec430d4494a08ea9524e0f9ce1794452fae9d225 100644 (file)
@@ -630,7 +630,7 @@ void update_bootstrap_file(JCR *jcr)
 
       VOL_PARAMS *VolParams = NULL;
       int VolCount;
-      char edt[50];
+      char edt[50], ed1[50], ed2[50];
 
       if (*fname == '|') {
          got_pipe = 1;
@@ -664,10 +664,9 @@ void update_bootstrap_file(JCR *jcr)
             }
             fprintf(fd, "VolSessionId=%u\n", jcr->VolSessionId);
             fprintf(fd, "VolSessionTime=%u\n", jcr->VolSessionTime);
-            fprintf(fd, "VolFile=%u-%u\n", VolParams[i].StartFile,
-                         VolParams[i].EndFile);
-            fprintf(fd, "VolBlock=%u-%u\n", VolParams[i].StartBlock,
-                         VolParams[i].EndBlock);
+            fprintf(fd, "VolAddr=%s-%s\n", 
+                    edit_uint64(VolParams[i].StartAddr, ed1),
+                    edit_uint64(VolParams[i].EndAddr, ed2));
             fprintf(fd, "FileIndex=%d-%d\n", VolParams[i].FirstIndex,
                          VolParams[i].LastIndex);
          }
index b3081a6e73205c43fea0bed318f33a8c1a5d9ec6..b0fbe3b7597e512cd4b35ff742a9bbf860cc55bc 100644 (file)
@@ -363,18 +363,6 @@ static uint32_t write_bsr(UAContext *ua, RESTORE_CTX &rx, FILE *fd)
             }
             fprintf(fd, "VolSessionId=%u\n", bsr->VolSessionId);
             fprintf(fd, "VolSessionTime=%u\n", bsr->VolSessionTime);
-//            if (bsr->VolParams[i].StartFile == bsr->VolParams[i].EndFile) {
-//               fprintf(fd, "VolFile=%u\n", bsr->VolParams[i].StartFile);
-//            } else {
-//               fprintf(fd, "VolFile=%u-%u\n", bsr->VolParams[i].StartFile,
-//                       bsr->VolParams[i].EndFile);
-//            }
-//            if (bsr->VolParams[i].StartBlock == bsr->VolParams[i].EndBlock) {
-//               fprintf(fd, "VolBlock=%u\n", bsr->VolParams[i].StartBlock);
-//            } else {
-//               fprintf(fd, "VolBlock=%u-%u\n", bsr->VolParams[i].StartBlock,
-//                       bsr->VolParams[i].EndBlock);
-//            }
             fprintf(fd, "VolAddr=%s-%s\n", edit_uint64(bsr->VolParams[i].StartAddr, ed1),
                     edit_uint64(bsr->VolParams[i].EndAddr, ed2));
    //       Dmsg2(100, "bsr VolParam FI=%u LI=%u\n",
@@ -431,18 +419,6 @@ static uint32_t write_bsr(UAContext *ua, RESTORE_CTX &rx, FILE *fd)
             }
             fprintf(fd, "VolSessionId=%u\n", bsr->VolSessionId);
             fprintf(fd, "VolSessionTime=%u\n", bsr->VolSessionTime);
-//            if (bsr->VolParams[i].StartFile == bsr->VolParams[i].EndFile) {
-//               fprintf(fd, "VolFile=%u\n", bsr->VolParams[i].StartFile);
-//            } else {
-//               fprintf(fd, "VolFile=%u-%u\n", bsr->VolParams[i].StartFile,
-//                       bsr->VolParams[i].EndFile);
-//            }
-//            if (bsr->VolParams[i].StartBlock == bsr->VolParams[i].EndBlock) {
-//               fprintf(fd, "VolBlock=%u\n", bsr->VolParams[i].StartBlock);
-//            } else {
-//               fprintf(fd, "VolBlock=%u-%u\n", bsr->VolParams[i].StartBlock,
-//                       bsr->VolParams[i].EndBlock);
-//            }
             fprintf(fd, "VolAddr=%s-%s\n", edit_uint64(bsr->VolParams[i].StartAddr, ed1),
                     edit_uint64(bsr->VolParams[i].EndAddr, ed2));
    //       Dmsg2(100, "bsr VolParam FI=%u LI=%u\n",
index 9304c8886ebddc65e1607e8b8414cdefca38192e..ae0719b8ba8cdafe9ea8df5f1766ae4abc0863d0 100644 (file)
@@ -409,7 +409,7 @@ static int match_all(BSR *bsr, DEV_RECORD *rec, VOLUME_LABEL *volrec,
 
    if (!match_voladdr(bsr, bsr->voladdr, rec, 1)) {
       if (bsr->voladdr) {
-         Dmsg3(dbglevel, "Fail on Addr=%lld. bsr=%lld,%lld\n", 
+         Dmsg3(dbglevel, "Fail on Addr=%llu. bsr=%llu,%llu\n", 
                get_record_address(rec), bsr->voladdr->saddr, bsr->voladdr->eaddr);
       }
       goto no_match;
@@ -641,7 +641,7 @@ static int match_voladdr(BSR *bsr, BSR_VOLADDR *voladdr, DEV_RECORD *rec, bool d
       return 1;                       /* All File records OK for this match */
    }
    uint64_t addr = get_record_address(rec);
-//  Dmsg3(dbglevel, "match_voladdr: saddr=%lld eaddr=%lld recaddr=%lld\n",
+//  Dmsg3(dbglevel, "match_voladdr: saddr=%llu eaddr=%llu recaddr=%llu\n",
 //             volblock->saddr, volblock->eaddr, addr);
    if (voladdr->saddr <= addr && voladdr->eaddr >= addr) {
       return 1;
@@ -658,7 +658,7 @@ static int match_voladdr(BSR *bsr, BSR_VOLADDR *voladdr, DEV_RECORD *rec, bool d
    if (voladdr->done && done) {
       bsr->done = true;
       bsr->root->reposition = true;
-      Dmsg2(dbglevel, "bsr done from voladdr rec=%lld voleaddr=%lld\n",
+      Dmsg2(dbglevel, "bsr done from voladdr rec=%llu voleaddr=%llu\n",
             addr, voladdr->eaddr);
    }
    return 0;
index 4603dbaeaac48ce1519b0ec9a444b8123f0c272b..b2790e7f6a961cbcd68604551223d5b9feddc883 100644 (file)
@@ -744,7 +744,7 @@ void dump_volblock(BSR_VOLBLOCK *volblock)
 void dump_voladdr(BSR_VOLADDR *voladdr)
 {
    if (voladdr) {
-      Pmsg2(-1, _("VolAddr    : %lld-%lld\n"), voladdr->saddr, voladdr->eaddr);
+      Pmsg2(-1, _("VolAddr    : %llu-%llu\n"), voladdr->saddr, voladdr->eaddr);
       dump_voladdr(voladdr->next);
    }
 }
index 03605aee1f4f669cdebead7bbb47c9d625b46381..b57b9ecaaa00c26f5aee5f4d66f070bc602640d2 100644 (file)
@@ -10,6 +10,8 @@ filepattern (restore with regex in bsr)
 mixed priorities
 
 General:
+19Dec08
+ebl  Cleanup director VolParam struct
 18Dec08
 ebl  Replace File:Block in BSR by Address to fix #1190
 16Dec08