From ef8cb5f11168183be77b1c121a9171b2ea9fbaab Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Fri, 1 Apr 2022 15:20:42 +0200 Subject: Make gc reserve a global resource --- zenstore/include/zenstore/gc.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'zenstore/include') diff --git a/zenstore/include/zenstore/gc.h b/zenstore/include/zenstore/gc.h index b8ba338f0..bc8dee9a3 100644 --- a/zenstore/include/zenstore/gc.h +++ b/zenstore/include/zenstore/gc.h @@ -78,6 +78,9 @@ public: GcClock::Duration MaxCacheDuration() const; void MaxCacheDuration(GcClock::Duration Duration); + void DiskReservePath(const std::filesystem::path& Path); + uint64_t ClaimGCReserve(); + inline bool Expired(GcClock::Tick TickCount) { return Time() - GcClock::TimePointFromTick(TickCount) > MaxCacheDuration(); } private: @@ -170,6 +173,7 @@ struct GcSchedulerConfig std::chrono::seconds MaxCacheDuration{86400}; bool CollectSmallObjects = true; bool Enabled = true; + uint64_t DiskReserveSize = 1ul << 28; }; /** -- cgit v1.2.3