src/worker.cc
// Write the data to the file.
Write the data to the file.
Write the data to the file .
bool FileThread::WritePages(int fd) {
  int strict = sat_->strict();
  lseek64(fd, 0, SEEK_SET);
  for (int i = 0; i < sat_->disk_pages(); i++) {
    struct page_entry src;
    if (!GetValidPage(&src))
      return false;
    page_recs_[i].pattern = src.pattern;
    page_recs_[i].src = src.addr;
    if (strict)
      CrcCheckPage(&src);
    SectorTagPage(&src, i);
    bool result = WritePageToFile(fd, &src);
    if (!PutEmptyPage(&src))
      return false;
    if (!result)
      return false;
  }
  return os_->FlushPageCache(); 
}
bool FileThread :: WritePages ( int fd ) { int strict = sat_ -> strict ( ) ; lseek64 ( fd , 0 , SEEK_SET ) ; for ( int i = 0 ; i < sat_ -> disk_pages ( ) ; i ++ ) { struct page_entry src ; if ( ! GetValidPage ( & src ) ) return false ; page_recs_ [ i ] . pattern = src . pattern ; page_recs_ [ i ] . src = src . addr ; if ( strict ) CrcCheckPage ( & src ) ; SectorTagPage ( & src , i ) ; bool result = WritePageToFile ( fd , & src ) ; if ( ! PutEmptyPage ( & src ) ) return false ; if ( ! result ) return false ; } return os_ -> FlushPageCache ( ) ; }
Write the data to the file.
Write the data to the file .
// Start fresh at beginning of file for each batch of pages. // Save expected pattern. // Check data correctness. // If O_DIRECT worked, this will be a NOP.