MCPcopy Create free account
hub / github.com/facebook/CacheLib / clearPrevState

Method clearPrevState

cachelib/allocator/NvmCacheState.cpp:149–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147time_t NvmCacheState::getCreationTime() const { return creationTime_; }
148
149void NvmCacheState::clearPrevState() {
150 auto dropFile = getFileNameFor(kShouldDropNvmCache);
151 if (::unlink(dropFile.data()) != 0 && errno != ENOENT) {
152 util::throwSystemError(errno, "Failed to delete nvm run file");
153 }
154 XDCHECK(metadataFile_);
155 ftruncate(metadataFile_->fd(), 0);
156}
157
158void NvmCacheState::markSafeShutDown() {
159 XDCHECK(metadataFile_);

Callers 2

initNvmCacheMethod · 0.80
TEST_FFunction · 0.80

Calls 2

throwSystemErrorFunction · 0.85
dataMethod · 0.45

Tested by 1

TEST_FFunction · 0.64