diff status.cpp @ 432:62a0515f59be api-inversion

Include track_lengths data structure in struct adb. Remove mapping of trackTable where I can...
author mas01cr
date Wed, 24 Dec 2008 10:55:44 +0000
parents 58b88ab69424
children
line wrap: on
line diff
--- a/status.cpp	Wed Dec 24 10:55:40 2008 +0000
+++ b/status.cpp	Wed Dec 24 10:55:44 2008 +0000
@@ -12,17 +12,6 @@
   unsigned dudCount = 0;
   unsigned nullCount = 0;
 
-  size_t trackTableLength = ALIGN_PAGE_UP(adb->header->numFiles * O2_TRACKTABLE_ENTRY_SIZE);
-  unsigned *trackTable = 0;
-  void *tmp = 0;
-  if (adb->header->length > 0)  {
-    tmp = mmap(0, trackTableLength, PROT_READ, MAP_SHARED, adb->fd, adb->header->trackTableOffset);
-    if (tmp == (void *) -1) {
-      return 1;
-    }
-    trackTable = (unsigned *) tmp;
-  }
-
   for(unsigned k = 0; k < adb->header->numFiles; k++) {
     /* FIXME: this bare "16" here reveals a problem (or maybe two).
      * 16 here means the default value of the sequenceLength parameter
@@ -38,20 +27,14 @@
      * information, but at present it's probably completely unused, so
      * the compromise for now is to hardwire the 16.
      */ 
-    if(trackTable[k] < 16) {
+    if((*adb->track_lengths)[k] < 16) {
       dudCount++; 
-      if(!trackTable[k]) {
+      if(!(*adb->track_lengths)[k]) {
 	nullCount++; 
       } 
     }
   }
 
-  if(adb->header->length > 0) {
-    if(munmap(trackTable, trackTableLength)) {
-      return 1;
-    }
-  }
-
   status->numFiles = adb->header->numFiles;
   status->dim = adb->header->dim;
   status->length = adb->header->length;