-/*
- * Subroutines to handle Catalog reqests sent to the Director
- * Reqests/commands from the Director are handled in dircmd.c
- *
- * Kern Sibbald, December 2000
- *
- * Version $Id$
- */
/*
Bacula® - The Network Backup Solution
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ * Subroutines to handle Catalog reqests sent to the Director
+ * Reqests/commands from the Director are handled in dircmd.c
+ *
+ * Kern Sibbald, December 2000
+ *
+ * Version $Id$
+ */
#include "bacula.h" /* pull in global headers */
#include "stored.h" /* pull in Storage Deamon headers */
/*
* Get info on the next appendable volume in the Director's database
- * Returns: true on success
- * false on failure
+ *
+ * Returns: true on success dcr->VolumeName is volume
+ * reserve_volume() called on Volume name
+ * false on failure dcr->VolumeName[0] == 0
*
* Volume information returned in dcr
*
}
if (found) {
Dmsg0(400, "dir_find_next_appendable_volume return true\n");
- new_volume(dcr, dcr->VolumeName); /* reserve volume */
+ reserve_volume(dcr, dcr->VolumeName); /* reserve volume */
V(vol_info_mutex);
unlock_reservations();
return true;
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);
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);
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,
Jmsg(jcr, M_INFO, 0, "%s", dev->errmsg);
return false;
}
- P(dev->mutex);
+ dev->dlock();
got_vol = dir_find_next_appendable_volume(dcr); /* get suggested volume */
- V(dev->mutex);
+ dev->dunlock();
if (got_vol) {
return true;
} else {
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"),