MCPcopy Create free account
hub / github.com/catboost/catboost / FlushCache

Method FlushCache

util/system/file.cpp:818–834  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

816}
817
818bool TFileHandle::FlushCache(i64 offset, i64 length, bool wait) noexcept {
819#if HAVE_SYNC_FILE_RANGE
820 int flags = SYNC_FILE_RANGE_WRITE;
821 if (wait) {
822 flags |= SYNC_FILE_RANGE_WAIT_AFTER;
823 }
824 int ret = ::sync_file_range(Fd_, offset, length, flags);
825 return ret == 0 || errno == EROFS;
826#else
827 Y_UNUSED(offset);
828 Y_UNUSED(length);
829 if (wait) {
830 return FlushData();
831 }
832 return true;
833#endif
834}
835
836TString DecodeOpenMode(ui32 mode0) {
837 ui32 mode = mode0;

Callers 4

FlushAsyncMethod · 0.45
FlushSyncMethod · 0.45
FlushCacheMethod · 0.45
TestCacheMethod · 0.45

Calls 1

Y_UNUSEDFunction · 0.85

Tested by 1

TestCacheMethod · 0.36