}
if (jcr->rstore) {
Dmsg1(200, "Rstore=%s\n", jcr->rstore->name());
- if (jcr->rstore->NumConcurrentReadJobs == 0 &&
- jcr->rstore->NumConcurrentJobs < jcr->rstore->MaxConcurrentJobs) {
- /* Simple case, first job */
- jcr->rstore->NumConcurrentReadJobs = 1;
+ if (jcr->rstore->NumConcurrentJobs < jcr->rstore->MaxConcurrentJobs) {
+ jcr->rstore->NumConcurrentReadJobs++;
jcr->rstore->NumConcurrentJobs++;
- Dmsg0(200, "Set rncj=1\n");
- /* We can do this only if multi-drive autochanger */
-// } else if (jcr->rstore->NumConcurrentJobs < jcr->rstore->MaxConcurrentJobs
-// && jcr->rstore->NumConcurrentReadJobs < jcr->rstore->MaxConcurrentReadJobs) {
-// jcr->rstore->NumConcurrentReadJobs++;
-// jcr->rstore->NumConcurrentJobs++;
-// Dmsg1(200, "Inc rncj=%d\n", jcr->rstore->NumConcurrentJobs);
+ Dmsg1(200, "Inc rncj=%d\n", jcr->rstore->NumConcurrentJobs);
} else {
Dmsg1(200, "Fail rncj=%d\n", jcr->rstore->NumConcurrentJobs);
set_jcr_job_status(jcr, JS_WaitStoreRes);
if (jcr->wstore) {
Dmsg1(200, "Wstore=%s\n", jcr->wstore->name());
- if (jcr->wstore->NumConcurrentJobs == 0 &&
- jcr->wstore->NumConcurrentJobs < jcr->wstore->MaxConcurrentJobs) {
- /* Simple case, first job */
- jcr->wstore->NumConcurrentJobs = 1;
- Dmsg0(200, "Set wncj=1\n");
- } else if (jcr->wstore->NumConcurrentJobs < jcr->wstore->MaxConcurrentJobs) {
+ if (jcr->wstore->NumConcurrentJobs < jcr->wstore->MaxConcurrentJobs) {
jcr->wstore->NumConcurrentJobs++;
Dmsg1(200, "Inc wncj=%d\n", jcr->wstore->NumConcurrentJobs);
} else if (jcr->rstore) {
goto get_out; /* error return */
}
+ dcr->do_swapping();
+
autoload_device(dcr, 0, NULL);
/*
} else {
bstrncpy(dev->BadVolName, dev->VolHdr.VolumeName, sizeof(dev->BadVolName));
}
+ unload_autochanger(dcr, -1);
/* Fall through */
default:
Jmsg1(jcr, M_WARNING, 0, "%s", jcr->errmsg);
bool is_eod_valid();
int check_volume_label(bool &ask, bool &autochanger);
void release_volume();
+ void do_swapping();
};
/*
goto bail_out;
}
recycle = false;
+
if (dev->must_unload()) {
- Dmsg0(150, "mount_next_volume release=1\n");
- unload_autochanger(dcr, -1);
- release_volume();
- dev->clear_unload();
ask = true; /* ask operator to mount tape */
}
- /*
- * See if we are asked to swap the Volume from another device
- * if so, unload the other device here, and attach the
- * volume to our drive.
- */
- if (dev->swap_dev) {
- Dmsg1(100, "Swap unloading %s\n", dev->swap_dev->print_name());
- if (dev->swap_dev->must_unload()) {
- unload_dev(dcr, dev->swap_dev);
- }
- if (dev->vol) {
- dev->vol->clear_swapping();
- dev->vol->set_in_use();
- dev->VolHdr.VolumeName[0] = 0; /* don't yet have right Volume */
- }
- dev->swap_dev = NULL;
- }
- if (dev->must_load()) {
- dev->clear_load();
- dev->clear_volhdr(); /* force "load" */
- }
+ do_swapping();
+
if (!is_suitable_volume_mounted()) {
bool have_vol = false;
/* Do we have a candidate volume? */
return dir_get_volume_info(this, GET_VOL_INFO_FOR_WRITE);
}
+void DCR::do_swapping()
+{
+ if (dev->must_unload()) {
+ Dmsg0(150, "mount_next_volume release=1\n");
+ unload_autochanger(this, -1);
+ release_volume();
+ dev->clear_unload();
+ }
+ /*
+ * See if we are asked to swap the Volume from another device
+ * if so, unload the other device here, and attach the
+ * volume to our drive.
+ */
+ if (dev->swap_dev) {
+ Dmsg1(100, "Swap unloading %s\n", dev->swap_dev->print_name());
+ if (dev->swap_dev->must_unload()) {
+ unload_dev(this, dev->swap_dev);
+ }
+ if (dev->vol) {
+ dev->vol->clear_swapping();
+ dev->vol->set_in_use();
+ dev->VolHdr.VolumeName[0] = 0; /* don't yet have right Volume */
+ }
+ dev->swap_dev = NULL;
+ }
+ if (dev->must_load()) {
+ dev->clear_load();
+ dev->clear_volhdr(); /* force "load" */
+ }
+}
/*
#undef VERSION
#define VERSION "2.3.18"
-#define BDATE "12 April 2008"
-#define LSMDATE "12Apr08"
+#define BDATE "16 April 2008"
+#define LSMDATE "16Apr08"
#define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n"
#define BYEAR "2008" /* year for copyright messages in progs */
General:
+16Apr08
+kes Experiment with allowing multiple read jobs.
+kes Move final volume swapping code to DCR method and
+ call it from acquire_for_read().
+kes When wrong volume is mounted during read, unload_autochanger.
15Apr08
kes Integrate the libdbi changes from Joao Henrique Freitas
14Apr08