summaryrefslogtreecommitdiff
path: root/src/buildtool/storage/garbage_collector.hpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-06-18 15:46:56 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-07-05 12:58:35 +0200
commitb5a29ec0daf024fde9bd06f76cab8a12fd509aab (patch)
treeb1786fc20a5033aa6789ab37b916e072c4d3937a /src/buildtool/storage/garbage_collector.hpp
parentc88585ddf9386fb14154a4f3baa702569d55584a (diff)
downloadjustbuild-b5a29ec0daf024fde9bd06f76cab8a12fd509aab.tar.gz
Pass StorageConfig to GarbageCollector::SharedLock
Diffstat (limited to 'src/buildtool/storage/garbage_collector.hpp')
-rw-r--r--src/buildtool/storage/garbage_collector.hpp12
1 files changed, 9 insertions, 3 deletions
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 <optional>
#include <string>
+#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<LockFile>;
+ [[nodiscard]] auto static SharedLock(
+ StorageConfig const& storage_config) noexcept
+ -> std::optional<LockFile>;
private:
- [[nodiscard]] auto static ExclusiveLock() noexcept
+ [[nodiscard]] auto static ExclusiveLock(
+ StorageConfig const& storage_config) noexcept
-> std::optional<LockFile>;
- [[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.