MCPcopy Create free account
hub / github.com/LadybugDB/ladybug / getOrCreateShadowingFH

Method getOrCreateShadowingFH

src/storage/shadow_file.cpp:184–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

182}
183
184FileHandle* ShadowFile::getOrCreateShadowingFH() {
185 if (!shadowingFH) {
186 shadowingFH = bm.getFileHandle(shadowFilePath,
187 FileHandle::O_PERSISTENT_FILE_CREATE_NOT_EXISTS, vfs, nullptr);
188 if (shadowingFH->getNumPages() == 0) {
189 // Reserve the first page for the header.
190 shadowingFH->addNewPage();
191 }
192 }
193 return shadowingFH;
194}
195
196} // namespace storage
197} // namespace lbug

Callers

nothing calls this directly

Calls 3

addNewPageMethod · 0.80
getFileHandleMethod · 0.45
getNumPagesMethod · 0.45

Tested by

no test coverage detected