* This routine returns a 0 only if it is REALLY
* impossible to get the requested Volume.
*
+ * This routine is entered with the device blocked, but not
+ * locked.
+ *
*/
bool DCR::mount_next_write_volume()
{
ask = true; /* ask operator to mount tape */
do_find = true; /* re-find a volume after unload */
}
+ unlock_volumes();
do_unload();
do_swapping(true /*is_writing*/);
do_load(true /*is_writing*/);
+ lock_volumes();
if (do_find && !find_a_volume()) {
goto no_lock_bail_out;
* and move the tape to the end of data.
*
*/
+ unlock_volumes();
if (autoload_device(dcr, true/*writing*/, NULL) > 0) {
autochanger = true;
ask = false;
ask = retry >= 2;
do_find = true; /* do find_a_volume if we retry */
}
+ lock_volumes();
Dmsg1(150, "autoload_dev returns %d\n", autochanger);
/*
* If we autochanged to correct Volume or (we have not just
* This routine is meant to be called once the first pass
* to ensure that we have a candidate volume to mount.
* Otherwise, we ask the sysop to created one.
+ * Note, the the Volumes are locked on entry.
+ * They are unlocked on failure and remain locked on
+ * success. The caller must know this!!!
*/
bool DCR::find_a_volume()
{