MCPcopy Create free account
hub / github.com/apple/foundationdb / extendToCover

Function extendToCover

fdbserver/VersionedBTree.actor.cpp:2723–2741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2721 }
2722
2723 ACTOR static Future<Void> extendToCover(DWALPager* self, uint64_t pageID, Future<Void> previousExtension) {
2724 // Calculate new page count, round up to nearest multiple of growth size > pageID
2725 state int64_t newPageCount = pageID + SERVER_KNOBS->REDWOOD_PAGEFILE_GROWTH_SIZE_PAGES -
2726 (pageID % SERVER_KNOBS->REDWOOD_PAGEFILE_GROWTH_SIZE_PAGES);
2727
2728 // Indicate that extension to this new count has been started
2729 self->filePageCountPending = newPageCount;
2730
2731 // Wait for any previous extensions to complete
2732 wait(previousExtension);
2733
2734 // Grow the file
2735 wait(self->pageFile->truncate(newPageCount * self->physicalPageSize));
2736
2737 // Indicate that extension to the new count has been completed
2738 self->filePageCount = newPageCount;
2739
2740 return Void();
2741 }
2742
2743 // All returned futures are added to the operations vector
2744 Future<Void> writePhysicalPage(PagerEventReasons reason,

Callers 1

writePhysicalBlockFunction · 0.85

Calls 2

VoidClass · 0.50
truncateMethod · 0.45

Tested by

no test coverage detected