diff options
| author | Martin Ridgers <[email protected]> | 2024-09-17 13:26:52 +0200 |
|---|---|---|
| committer | Martin Ridgers <[email protected]> | 2024-09-19 15:26:13 +0200 |
| commit | 7f6e6461279b11d1fd60d24b4a490d608d47f51a (patch) | |
| tree | aad99d7f18607adf659ea42410470475e3679bce /src/zenserver/projectstore/projectstore.cpp | |
| parent | Removed redundant initialisation (diff) | |
| download | zen-7f6e6461279b11d1fd60d24b4a490d608d47f51a.tar.xz zen-7f6e6461279b11d1fd60d24b4a490d608d47f51a.zip | |
Mandatory IterateOplog() paging argument
Diffstat (limited to 'src/zenserver/projectstore/projectstore.cpp')
| -rw-r--r-- | src/zenserver/projectstore/projectstore.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp index ea45aa210..75a077e87 100644 --- a/src/zenserver/projectstore/projectstore.cpp +++ b/src/zenserver/projectstore/projectstore.cpp @@ -1100,7 +1100,7 @@ ProjectStore::Oplog::GatherReferences(GcContext& GcCtx) GcCtx.AddRetainedCids(Cids); Cids.clear(); } - }); + }, Paging{}); GcCtx.AddRetainedCids(Cids); } @@ -2032,14 +2032,14 @@ ProjectStore::Oplog::IterateFileMap( } void -ProjectStore::Oplog::IterateOplog(std::function<void(CbObjectView)>&& Handler, const Paging* EntryPaging) +ProjectStore::Oplog::IterateOplog(std::function<void(CbObjectView)>&& Handler, const Paging& EntryPaging) { RwLock::SharedLockScope _(m_OplogLock); IterateOplogLocked(std::move(Handler), EntryPaging); } void -ProjectStore::Oplog::IterateOplogLocked(std::function<void(CbObjectView)>&& Handler, const Paging* EntryPaging) +ProjectStore::Oplog::IterateOplogLocked(std::function<void(CbObjectView)>&& Handler, const Paging& EntryPaging) { ZEN_TRACE_CPU("Store::Oplog::IterateOplogLocked"); if (!m_Storage) @@ -2063,13 +2063,10 @@ ProjectStore::Oplog::IterateOplogLocked(std::function<void(CbObjectView)>&& Hand }); std::span<OplogEntryAddress> EntrySpan = Entries; - if (EntryPaging != nullptr) - { - int32_t Size = int32_t(Entries.size()); - int32_t Start = std::clamp(EntryPaging->Start, 0, Size); - int32_t End = std::clamp(EntryPaging->Start + EntryPaging->Count, 0, Size); - EntrySpan = EntrySpan.subspan(Start, End - Start); - } + int32_t Size = int32_t(Entries.size()); + int32_t Start = std::clamp(EntryPaging.Start, 0, Size); + int32_t End = std::clamp(EntryPaging.Start + EntryPaging.Count, 0, Size); + EntrySpan = EntrySpan.subspan(Start, End - Start); m_Storage->ReplayLogEntries(EntrySpan, [&](CbObjectView Op) { Handler(Op); }); } @@ -2123,7 +2120,7 @@ ProjectStore::Oplog::GetAttachmentsLocked(std::vector<IoHash>& OutAttachments, b Keys.push_back(KeyHash); AttachmentCounts.push_back(gsl::narrow<uint32_t>(OutAttachments.size() - CurrentAttachmentCount)); } - }); + }, Paging{}); if (StoreMetaDataOnDisk) { const IoHash* FirstAttachment = OutAttachments.data() + AttachmentOffset; @@ -4863,7 +4860,7 @@ ProjectStore::Rpc(HttpServerRequest& HttpReq, } OpCount++; - }); + }, Oplog::Paging{}); // Make sure we have references to our attachments Oplog->AddChunkMappings(NewChunkMappings); |