aboutsummaryrefslogtreecommitdiff
path: root/zenstore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-04-01 15:20:42 +0200
committerDan Engelbrecht <[email protected]>2022-04-01 15:20:42 +0200
commitef8cb5f11168183be77b1c121a9171b2ea9fbaab (patch)
treefc9abc4f409ce05a6f290e9857659e72f6aee3f8 /zenstore/include
parentfix entry validation (diff)
downloadzen-ef8cb5f11168183be77b1c121a9171b2ea9fbaab.tar.xz
zen-ef8cb5f11168183be77b1c121a9171b2ea9fbaab.zip
Make gc reserve a global resource
Diffstat (limited to 'zenstore/include')
-rw-r--r--zenstore/include/zenstore/gc.h4
1 files changed, 4 insertions, 0 deletions
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;
};
/**