]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix overzelous VolCatFiles updating by removing from askdir.c and doing only when...
authorKern Sibbald <kern@sibbald.com>
Mon, 8 Dec 2003 20:58:07 +0000 (20:58 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 8 Dec 2003 20:58:07 +0000 (20:58 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@841 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/acquire.c
bacula/src/stored/askdir.c
bacula/src/stored/block.c
bacula/src/stored/device.c

index 6991f271b5fc97ef67cd50ea9bb5f8480193115a..5cfb31bb6f5570efc2ea0a71a5c6ecd005b181bf 100644 (file)
@@ -307,6 +307,7 @@ int release_device(JCR *jcr, DEVICE *dev)
            if (dev_can_write(dev)) {
               weof_dev(dev, 1);
            }
+           dev->VolCatInfo.VolCatFiles = dev->file;   /* set number of files */
            dev->VolCatInfo.VolCatJobs++;              /* increment number of jobs */
            /* Note! do volume update before close, which zaps VolCatInfo */
             Dmsg0(100, "dir_update_vol_info. Release0\n");
@@ -324,6 +325,7 @@ int release_device(JCR *jcr, DEVICE *dev)
               jcr->VolCatInfo.VolCatName, jcr->Job);
         }
          Dmsg0(100, "dir_update_vol_info. Release1\n");
+        dev->VolCatInfo.VolCatFiles = dev->file;   /* set number of files */
         dev->VolCatInfo.VolCatJobs++;              /* increment number of jobs */
         dir_update_volume_info(jcr, dev, 0); /* send Volume info to Director */
       }
index c7a8e4616e828806a06bd1052ab20761d1614a84..1307a097512e5e2b381a742e3e7a3a79ce60868d 100644 (file)
@@ -172,7 +172,6 @@ int dir_update_volume_info(JCR *jcr, DEVICE *dev, int label)
       return 0;
    }
 
-   dev->VolCatInfo.VolCatFiles = dev->file;   /* set number of files */
    Dmsg1(100, "Update cat VolFiles=%d\n", dev->file);
    /* Just labeled or relabeled the tape */
    if (label) {
index 86eb95c4ad1148bacbe11f16119d58a518be2d6c..c74902de4b519e564ece3fe233cf05400bc132cc 100644 (file)
@@ -415,6 +415,7 @@ int write_block_to_dev(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
       }
       /* Don't do update after second EOF or file count will be wrong */
       Dmsg0(100, "dir_update_volume_info\n");
+      dev->VolCatInfo.VolCatFiles = dev->file;
       dir_update_volume_info(jcr, dev, 0);
       if (dev_cap(dev, CAP_TWOEOF) && weof_dev(dev, 1) != 0) { /* write eof */
          Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
@@ -434,12 +435,14 @@ int write_block_to_dev(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
            block->write_failed = true;
            dev->state |= (ST_EOF | ST_EOT | ST_WEOT);
             Dmsg0(100, "dir_update_volume_info\n");
+           dev->VolCatInfo.VolCatFiles = dev->file;
            dir_update_volume_info(jcr, dev, 0);
            return 0;   
         }
 
         /* Do bookkeeping to handle EOF just written */
          Dmsg0(100, "dir_update_volume_info\n");
+        dev->VolCatInfo.VolCatFiles = dev->file;
         dir_update_volume_info(jcr, dev, 0);
         if (!dir_create_jobmedia_record(jcr)) {
              Jmsg(jcr, M_ERROR, 0, _("Could not create JobMedia record for Volume=\"%s\" Job=%s\n"),
@@ -499,6 +502,7 @@ int write_block_to_dev(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
          Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
       }
       Dmsg0(100, "dir_update_volume_info\n");
+      dev->VolCatInfo.VolCatFiles = dev->file;
       dir_update_volume_info(jcr, dev, 0);
       if (dev_cap(dev, CAP_TWOEOF) && weof_dev(dev, 1) != 0) { /* end the tape */
          Jmsg(jcr, M_ERROR, 0, "%s", dev->errmsg);
index 0fad7a420f6f4374d8c217815598a7aa477e07e3..eaacb8fcd4ed1e358e73423936df89303f289ed3 100644 (file)
@@ -109,6 +109,7 @@ int fixup_device_block_write_error(JCR *jcr, DEVICE *dev, DEV_BLOCK *block)
    bstrncpy(dev->VolCatInfo.VolCatStatus, "Full", sizeof(dev->VolCatInfo.VolCatStatus));
    Dmsg2(100, "Call update_vol_info Stat=%s Vol=%s\n", 
       dev->VolCatInfo.VolCatStatus, dev->VolCatInfo.VolCatName);
+   dev->VolCatInfo.VolCatFiles = dev->file;   /* set number of files */
    dev->VolCatInfo.VolCatJobs++;             /* increment number of jobs */
    if (!dir_update_volume_info(jcr, dev, 0)) {   /* send Volume info to Director */
       P(dev->mutex);