| 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, |
no test coverage detected