]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/askdir.c
dhb Added comments for each function. There are questions above
[bacula/bacula] / bacula / src / stored / askdir.c
index 6525bfe7ded24a4533be291cb28309fdd7e8f2fa..dbc2b8fe2e0edd0a0c0ad0532fe7553888dede3e 100644 (file)
@@ -321,11 +321,6 @@ bool dir_update_volume_info(DCR *dcr, bool label)
       Pmsg0(000, _("NULL Volume name. This shouldn't happen!!!\n"));
       return false;
    }
-   if (dev->can_read()) {
-      Jmsg0(jcr, M_FATAL, 0, _("Attempt to update_volume_info in read mode!!!\n"));
-      Pmsg0(000, _("Attempt to update_volume_info in read mode!!!\n"));
-      return false;
-   }
 
    /* Lock during Volume update */
    P(vol_info_mutex);
@@ -344,8 +339,8 @@ bool dir_update_volume_info(DCR *dcr, bool label)
       vol->VolCatWrites, edit_uint64(vol->VolCatMaxBytes, ed2),
       LastWritten, vol->VolCatStatus, vol->Slot, label,
       InChanger,                      /* bool in structure */
-      edit_uint64(vol->VolReadTime, ed3),
-      edit_uint64(vol->VolWriteTime, ed4),
+      edit_int64(vol->VolReadTime, ed3),
+      edit_int64(vol->VolWriteTime, ed4),
       edit_uint64(vol->VolFirstWritten, ed5),
       vol->VolCatParts);
     Dmsg1(100, ">dird: %s", dir->msg);
@@ -464,7 +459,7 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr)
    bool got_vol = false;
 
    Dmsg0(400, "enter dir_ask_sysop_to_create_appendable_volume\n");
-   ASSERT(dev->dev_blocked);
+   ASSERT(dev->blocked());
    for ( ;; ) {
       if (job_canceled(jcr)) {
          Mmsg(dev->errmsg,
@@ -473,9 +468,9 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr)
          Jmsg(jcr, M_INFO, 0, "%s", dev->errmsg);
          return false;
       }
-      P(dev->mutex);
+      dev->lock();  
       got_vol = dir_find_next_appendable_volume(dcr);   /* get suggested volume */
-      V(dev->mutex);
+      dev->unlock();
       if (got_vol) {
          return true;
       } else {
@@ -550,7 +545,7 @@ bool dir_ask_sysop_to_mount_volume(DCR *dcr)
       Mmsg0(dev->errmsg, _("Cannot request another volume: no volume name given.\n"));
       return false;
    }
-   ASSERT(dev->dev_blocked);
+   ASSERT(dev->blocked());
    for ( ;; ) {
       if (job_canceled(jcr)) {
          Mmsg(dev->errmsg, _("Job %s canceled while waiting for mount on Storage Device %s.\n"),