]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/mount.c
Remove debug code
[bacula/bacula] / bacula / src / stored / mount.c
index 462b9b5b4f8f2a994903fc0ef6e5113b21c08ffe..a8646bd73ba450e65e39072f4f056676b20b8294 100644 (file)
@@ -64,6 +64,9 @@ enum {
  * 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()
 {
@@ -113,9 +116,11 @@ mount_next_vol:
       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;
@@ -138,6 +143,7 @@ mount_next_vol:
     * and move the tape to the end of data.
     *
     */
+   unlock_volumes();
    if (autoload_device(dcr, true/*writing*/, NULL) > 0) {
       autochanger = true;
       ask = false;
@@ -147,6 +153,7 @@ mount_next_vol:
       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