{
JCR *jcr = dcr->jcr;
BSOCK *dir = jcr->dir_bsock;
+ bool rtn;
Dmsg2(200, "dir_find_next_appendable_volume: reserved=%d Vol=%s\n",
dcr->reserved_device, dcr->VolumeName);
* the most available could already be mounted on another
* drive, so we continue looking for a not in use Volume.
*/
- lock_reservations();
+ lock_volumes();
P(vol_info_mutex);
dcr->volume_in_use = false;
for (int vol_index=1; vol_index < 40; vol_index++) {
unbash_spaces(dcr->media_type);
unbash_spaces(dcr->pool_name);
Dmsg1(100, ">dird %s", dir->msg);
- bool ok = do_get_volume_info(dcr);
- if (ok) {
+ if (do_get_volume_info(dcr)) {
if (!is_volume_in_use(dcr)) {
Dmsg0(400, "dir_find_next_appendable_volume return true\n");
if (reserve_volume(dcr, dcr->VolumeName) == 0) {
dcr->dev->print_name());
continue;
}
- V(vol_info_mutex);
- unlock_reservations();
- return true;
+ rtn = true;
+ goto get_out;
} else {
Dmsg1(100, "Volume %s is in use.\n", dcr->VolumeName);
dcr->volume_in_use = true;
dcr->dev->print_name());
break;
}
-
+ rtn = false;
dcr->VolumeName[0] = 0;
+
+get_out:
V(vol_info_mutex);
- unlock_reservations();
- return false;
+ unlock_volumes();
+ return rtn;
}
*/
void switch_device(DCR *dcr, DEVICE *dev)
{
- // lock_reservations();
DCR save_dcr;
dev->dlock();
bool is_volume_in_use(DCR *dcr)
{
- VOLRES *vol = find_volume(dcr);
+ bool rtn = false;
+ VOLRES *vol;
+
+ lock_volumes();
+ vol = find_volume(dcr);
if (!vol) {
Dmsg2(dbglvl, "jid=%u Vol=%s not in use.\n", jid(), dcr->VolumeName);
- return false; /* vol not in list */
+ goto get_out; /* vol not in list */
}
ASSERT(vol->dev != NULL);
if (dcr->dev == vol->dev) { /* same device OK */
Dmsg2(dbglvl, "jid=%u Vol=%s on same dev.\n", jid(), dcr->VolumeName);
- return false;
+ goto get_out;
} else {
Dmsg4(dbglvl, "jid=%u Vol=%s on %s we have %s\n", jid(), dcr->VolumeName,
vol->dev->print_name(), dcr->dev->print_name());
}
if (!vol->dev->is_busy()) {
Dmsg3(dbglvl, "jid=%u Vol=%s dev=%s not busy.\n", jid(), dcr->VolumeName, vol->dev->print_name());
- return false;
+ goto get_out;
} else {
Dmsg3(dbglvl, "jid=%u Vol=%s dev=%s busy.\n", jid(), dcr->VolumeName, vol->dev->print_name());
}
Dmsg3(dbglvl, "jid=%u Vol=%s in use by %s.\n", jid(), dcr->VolumeName, vol->dev->print_name());
- return true;
+ rtn = true;
+
+get_out:
+ unlock_volumes();
+ return rtn;
}
*/
#undef VERSION
-#define VERSION "2.2.9-b2"
-#define BDATE "24 March 2008"
-#define LSMDATE "24Mar08"
+#define VERSION "2.2.9-b3"
+#define BDATE "27 March 2008"
+#define LSMDATE "27Mar08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
Technical notes on version 2.2
General:
+Beta release Version 2.2.9-b3
+27Mar08
+kes Rework certain SD locking based on gdb tracebacks of deadlocks
+ sent by Eric. This code now uses only the volume_lock() rather
+ than the reservations lock when at EOM and acquiring a new
+ volume.
+kes Ensure only one exit point in several subroutines.
+
22Mar08
kes Fix to JobMedia fix.
kes Fix bug pointed out by Peter Much that causes the StorageId to