X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fstored%2Fread_record.c;h=8cd7b4f0b56e1789a0b92c64372dfeeb318eeb9a;hb=5c358307600ad7cd6983b8773f8d7dc1e7346c56;hp=6c2b52fe3cfd642dbbc3de776e3350c913777ae6;hpb=095ae896b3fa96e6c8db2105519552b785e6b005;p=bacula%2Fbacula diff --git a/bacula/src/stored/read_record.c b/bacula/src/stored/read_record.c index 6c2b52fe3c..8cd7b4f0b5 100644 --- a/bacula/src/stored/read_record.c +++ b/bacula/src/stored/read_record.c @@ -1,22 +1,7 @@ -/* - * - * This routine provides a routine that will handle all - * the gory little details of reading a record from a Bacula - * archive. It uses a callback to pass you each record in turn, - * as well as a callback for mounting the next tape. It takes - * care of reading blocks, applying the bsr, ... - * Note, this routine is really the heart of the restore routines, - * and we are *really* bit pushing here so be careful about making - * any modifications. - * - * Kern E. Sibbald, August MMII - * - * Version $Id$ - */ /* Bacula® - The Network Backup Solution - Copyright (C) 2002-2006 Free Software Foundation Europe e.V. + Copyright (C) 2002-2008 Free Software Foundation Europe e.V. The main author of Bacula is Kern Sibbald, with contributions from many others, a complete list can be found in the file AUTHORS. @@ -40,6 +25,21 @@ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, Switzerland, email:ftf@fsfeurope.org. */ +/* + * + * This routine provides a routine that will handle all + * the gory little details of reading a record from a Bacula + * archive. It uses a callback to pass you each record in turn, + * as well as a callback for mounting the next tape. It takes + * care of reading blocks, applying the bsr, ... + * Note, this routine is really the heart of the restore routines, + * and we are *really* bit pushing here so be careful about making + * any modifications. + * + * Kern E. Sibbald, August MMII + * + * Version $Id$ + */ #include "bacula.h" #include "stored.h" @@ -82,6 +82,7 @@ bool read_records(DCR *dcr, DEV_RECORD *trec = new_record(); Jmsg(jcr, M_INFO, 0, _("End of Volume at file %u on device %s, Volume \"%s\"\n"), dev->file, dev->print_name(), dcr->VolumeName); + volume_unused(dcr); /* mark volume unused */ if (!mount_cb(dcr)) { Jmsg(jcr, M_INFO, 0, _("End of all volumes.\n")); ok = false; /* Stop everything */ @@ -103,9 +104,10 @@ bool read_records(DCR *dcr, jcr->mount_next_volume = false; /* * The Device can change at the end of a tape, so refresh it - * from the dcr. + * and the block from the dcr. */ dev = dcr->dev; + block = dcr->block; /* * We just have a new tape up, now read the label (first record) * and pass it off to the callback routine, then continue @@ -226,11 +228,13 @@ bool read_records(DCR *dcr, * he wants to know if they matched the bsr, then he must * check the match_stat in the record */ ok = record_cb(dcr, rec); +#ifdef xxx /* * If this is the end of the Session (EOS) for this record * we can remove the record. Note, there is a separate * record to read each session. If a new session is seen * a new record will be created at approx line 157 above. + * However, it seg faults in the for line at lineno 196. */ if (rec->FileIndex == EOS_LABEL) { Dmsg2(dbglvl, "Remove EOS rec. SI=%d ST=%d\n", rec->VolSessionId, @@ -238,6 +242,7 @@ bool read_records(DCR *dcr, recs->remove(rec); free_record(rec); } +#endif continue; } /* end if label record */