]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/read_record.c
!!! I didn't run the regression tests.!!!
[bacula/bacula] / bacula / src / stored / read_record.c
index 0bd988bcc0b5f9f6d722a1c26ece2398910bf53e..5ecfdf7c4e8ecd15363dd820be5cb86c9f77e9e1 100644 (file)
@@ -11,7 +11,7 @@
  *   Version $Id$
  */
 /*
-   Copyright (C) 2000-2003 Kern Sibbald and John Walker
+   Copyright (C) 2000-2004 Kern Sibbald and John Walker
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License as
@@ -41,10 +41,12 @@ static int try_repositioning(JCR *jcr, DEV_RECORD *rec, DEVICE *dev);
 static char *rec_state_to_str(DEV_RECORD *rec);
 #endif
 
-bool read_records(JCR *jcr,  DEVICE *dev, 
+bool read_records(DCR *dcr,
        bool record_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block, DEV_RECORD *rec),
        bool mount_cb(JCR *jcr, DEVICE *dev, DEV_BLOCK *block))
 {
+   JCR *jcr = dcr->jcr;
+   DEVICE *dev = dcr->dev;
    DEV_BLOCK *block;
    DEV_RECORD *rec = NULL;
    uint32_t record;
@@ -54,7 +56,7 @@ bool read_records(JCR *jcr,  DEVICE *dev,
    dlist *recs;                        /* linked list of rec packets open */
 
    block = new_block(dev);
-   recs = new dlist(rec, &rec->link);
+   recs = New(dlist(rec, &rec->link));
    position_to_first_file(jcr, dev);
 
    for ( ; ok && !done; ) {
@@ -62,7 +64,7 @@ bool read_records(JCR *jcr,  DEVICE *dev,
         ok = false;
         break;
       }
-      if (!read_block_from_device(jcr, dev, block, CHECK_BLOCK_NUMBERS)) {
+      if (!read_block_from_device(dcr, block, CHECK_BLOCK_NUMBERS)) {
         if (dev_state(dev, ST_EOT)) {
            DEV_RECORD *trec = new_record();
 
@@ -87,7 +89,7 @@ bool read_records(JCR *jcr,  DEVICE *dev,
             *  and pass it off to the callback routine, then continue
             *  most likely reading the previous record.
             */
-           read_block_from_device(jcr, dev, block, NO_BLOCK_NUMBER_CHECK);
+           read_block_from_device(dcr, block, NO_BLOCK_NUMBER_CHECK);
            read_record_from_block(block, trec);
            handle_session_record(dev, trec, &sessrec);
            ok = record_cb(jcr, dev, block, trec);