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(); } }
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(); } }
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(); } }
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(); } }
MemoryMappedFile::Flushable * MemoryMappedFile::prepareFlush() { return new PosixFlushable( viewForFlushing() , fd , len ); }
void MemoryMappedFile::flush(bool sync) { if ( views.empty() || fd == 0 ) return; if ( msync(viewForFlushing(), len, sync ? MS_SYNC : MS_ASYNC) ) problem() << "msync " << errnoWithDescription() << endl; }
MemoryMappedFile::Flushable * MemoryMappedFile::prepareFlush() { return new WindowsFlushable( this, viewForFlushing() , fd , filename() , _flushMutex ); }