From b5a29ec0daf024fde9bd06f76cab8a12fd509aab Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Tue, 18 Jun 2024 15:46:56 +0200 Subject: Pass StorageConfig to GarbageCollector::SharedLock --- src/buildtool/storage/garbage_collector.hpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/buildtool/storage/garbage_collector.hpp') diff --git a/src/buildtool/storage/garbage_collector.hpp b/src/buildtool/storage/garbage_collector.hpp index 0d80def0..18c9b280 100644 --- a/src/buildtool/storage/garbage_collector.hpp +++ b/src/buildtool/storage/garbage_collector.hpp @@ -20,6 +20,7 @@ #include #include +#include "src/buildtool/storage/config.hpp" #include "src/utils/cpp/file_locking.hpp" // forward declarations @@ -82,14 +83,19 @@ class GarbageCollector { bool no_rotation = false) noexcept -> bool; /// \brief Acquire shared lock to prevent garbage collection from running. + /// \param storage_config Storage to be locked. /// \returns The acquired lock file on success or nullopt otherwise. - [[nodiscard]] auto static SharedLock() noexcept -> std::optional; + [[nodiscard]] auto static SharedLock( + StorageConfig const& storage_config) noexcept + -> std::optional; private: - [[nodiscard]] auto static ExclusiveLock() noexcept + [[nodiscard]] auto static ExclusiveLock( + StorageConfig const& storage_config) noexcept -> std::optional; - [[nodiscard]] auto static LockFilePath() noexcept -> std::filesystem::path; + [[nodiscard]] auto static LockFilePath( + StorageConfig const& storage_config) noexcept -> std::filesystem::path; /// \brief Remove spliced objects from the youngest generation and split /// objects that are larger than the threshold. -- cgit v1.2.3