]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/match_bsr.c
Add extra lock debug code but turned off
[bacula/bacula] / bacula / src / stored / match_bsr.c
index db0ef9d95972c35afab01954c9941890e011f8ce..2ba46e9c524ab7a270686f43ac71f3e013d28492 100644 (file)
@@ -1,7 +1,7 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2002-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2002-2010 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.
@@ -31,7 +31,6 @@
  *
  *     Kern Sibbald, June MMII
  *
- *   Version $Id$
  */
 
 /*
@@ -145,16 +144,18 @@ static int match_fileregex(BSR *bsr, DEV_RECORD *rec, JCR *jcr)
    if (bsr->fileregex_re == NULL)
       return 1;
 
-   if (bsr->attr == NULL)
+   if (bsr->attr == NULL) {
       bsr->attr = new_attr(jcr);
+   }
 
-   /* The code breaks if the first record associated with a file is
+   /*
+    * The code breaks if the first record associated with a file is
     * not of this type
     */
    if (rec->Stream == STREAM_UNIX_ATTRIBUTES ||
        rec->Stream == STREAM_UNIX_ATTRIBUTES_EX) {
       bsr->skip_file = false;
-      if (unpack_attributes_record(jcr, rec->Stream, rec->data, bsr->attr)) {
+      if (unpack_attributes_record(jcr, rec->Stream, rec->data, rec->data_len, bsr->attr)) {
          if (regexec(bsr->fileregex_re, bsr->attr->fname, 0, NULL, 0) == 0) {
             Dmsg2(dbglevel, "Matched pattern, fname=%s FI=%d\n",
                   bsr->attr->fname, rec->FileIndex);
@@ -635,13 +636,24 @@ static int match_voladdr(BSR *bsr, BSR_VOLADDR *voladdr, DEV_RECORD *rec, bool d
    if (!voladdr) {
       return 1;                       /* no specification matches all */
    }
+
+#ifdef xxx
+
    /* For the moment, these tests work only with disk. */
    if (rec->state & REC_ISTAPE) {
-      return 1;                       /* All File records OK for this match */
+      uint32_t sFile = (voladdr->saddr)>>32;
+      uint32_t eFile = (voladdr->eaddr)>>32;
+      if (sFile <= rec->File && eFile >= rec->File) {
+         return 1;
+      }
    }
+
+#endif
+
    uint64_t addr = get_record_address(rec);
-//  Dmsg3(dbglevel, "match_voladdr: saddr=%llu eaddr=%llu recaddr=%llu\n",
-//             volblock->saddr, volblock->eaddr, addr);
+   Dmsg6(dbglevel, "match_voladdr: saddr=%llu eaddr=%llu recaddr=%llu sfile=%u efile=%u recfile=%u\n",
+         voladdr->saddr, voladdr->eaddr, addr, voladdr->saddr>>32, voladdr->eaddr>>32, addr>>32);
+
    if (voladdr->saddr <= addr && voladdr->eaddr >= addr) {
       return 1;
    }