src/worker.cc
// Open the file for access.
Open the file for access.
Open the file for access .
bool FileThread::OpenFile(int *pfile) {
  bool no_O_DIRECT = false;
  int flags = O_RDWR | O_CREAT | O_SYNC;
  int fd = open(filename_.c_str(), flags | O_DIRECT, 0644);
  if (O_DIRECT != 0 && fd < 0 && errno == EINVAL) {
    no_O_DIRECT = true;
    fd = open(filename_.c_str(), flags, 0644); 
  }
  if (fd < 0) {
    logprintf(0, "Process Error: Failed to create file %s!!\n",
              filename_.c_str());
    pages_copied_ = 0;
    return false;
  }
  if (no_O_DIRECT)
    os_->ActivateFlushPageCache(); 
  *pfile = fd;
  return true;
}
bool FileThread :: OpenFile ( int * pfile ) { bool no_O_DIRECT = false ; int flags = O_RDWR | O_CREAT | O_SYNC ; int fd = open ( filename_ . c_str ( ) , flags | O_DIRECT , 0644 ) ; if ( O_DIRECT != 0 && fd < 0 && errno == EINVAL ) { no_O_DIRECT = true ; fd = open ( filename_ . c_str ( ) , flags , 0644 ) ; } if ( fd < 0 ) { logprintf ( 0 , " \n " , filename_ . c_str ( ) ) ; pages_copied_ = 0 ; return false ; } if ( no_O_DIRECT ) os_ -> ActivateFlushPageCache ( ) ; * pfile = fd ; return true ; }
Open the file for access.
Open the file for access .
// Try without O_DIRECT // Not using O_DIRECT fixed EINVAL