aboutsummaryrefslogtreecommitdiff
path: root/zenstore/gc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zenstore/gc.cpp')
-rw-r--r--zenstore/gc.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp
index 3395761d6..c3cb77b69 100644
--- a/zenstore/gc.cpp
+++ b/zenstore/gc.cpp
@@ -11,6 +11,7 @@ struct GcContext::GcState
{
CasChunkSet m_CasChunks;
CasChunkSet m_CidChunks;
+ bool m_DeletionMode = true;
};
GcContext::GcContext() : m_State(std::make_unique<GcState>())
@@ -45,6 +46,17 @@ GcContext::FilterCas(std::span<const IoHash> Cas, std::function<void(const IoHas
m_State->m_CasChunks.FilterChunks(Cas, [&](const IoHash& Hash) { KeepFunc(Hash); });
}
+bool
+GcContext::IsDeletionMode() const
+{
+ return m_State->m_DeletionMode;
+}
+void
+GcContext::SetDeletionMode(bool NewState)
+{
+ m_State->m_DeletionMode = NewState;
+}
+
//////////////////////////////////////////////////////////////////////////
GcContributor::GcContributor(CasGc& Gc) : m_Gc(Gc)
@@ -115,6 +127,7 @@ CasGc::CollectGarbage()
// First gather reference set
GcContext GcCtx;
+ GcCtx.SetDeletionMode(false);
for (GcContributor* Contributor : m_GcContribs)
{