示例#1
0
 void MemoryMappedFile::flush(bool sync) {
     uassert(13056, "Async flushing not supported on windows", sync);
     if( !views.empty() ) {
         WindowsFlushable f( this, viewForFlushing() , fd , filename() , _flushMutex);
         f.flush();
     }
 }
示例#2
0
void MemoryMappedFile::flush(bool sync) {
    invariant(!(isOptionSet(Options::READONLY)));
    uassert(13056, "Async flushing not supported on windows", sync);
    if (!views.empty()) {
        WindowsFlushable f(this, viewForFlushing(), fd, _uniqueId, filename(), _flushMutex);
        f.flush();
    }
}
示例#3
0
 void MemoryMappedFile::flush(bool sync) {
     if ( views.empty() || fd == 0 )
         return;
     if ( msync(viewForFlushing(), len, sync ? MS_SYNC : MS_ASYNC) ) {
         // msync failed, this is very bad
         problem() << "msync failed: " << errnoWithDescription();
         dataSyncFailedHandler();
     }
 }
示例#4
0
void MemoryMappedFile::flush(bool sync) {
    if (views.empty() || fd == 0)
        return;

    bool useFsync = sync && !ProcessInfo::preferMsyncOverFSync();

    if (useFsync ? fsync(fd) != 0 : msync(viewForFlushing(), len, sync ? MS_SYNC : MS_ASYNC)) {
        // msync failed, this is very bad
        log() << (useFsync ? "fsync failed: " : "msync failed: ") << errnoWithDescription()
              << " file: " << filename() << endl;
        dataSyncFailedHandler();
    }
}
示例#5
0
 MemoryMappedFile::Flushable * MemoryMappedFile::prepareFlush() {
     return new PosixFlushable( viewForFlushing() , fd , len );
 }
示例#6
0
 void MemoryMappedFile::flush(bool sync) {
     if ( views.empty() || fd == 0 )
         return;
     if ( msync(viewForFlushing(), len, sync ? MS_SYNC : MS_ASYNC) )
         problem() << "msync " << errnoWithDescription() << endl;
 }
示例#7
0
 MemoryMappedFile::Flushable * MemoryMappedFile::prepareFlush() {
     return new WindowsFlushable( this, viewForFlushing() , fd , filename() , _flushMutex );
 }