diff options
Diffstat (limited to 'zenstore/filecas.h')
| -rw-r--r-- | zenstore/filecas.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/zenstore/filecas.h b/zenstore/filecas.h index de79b8b81..29c28560e 100644 --- a/zenstore/filecas.h +++ b/zenstore/filecas.h @@ -33,7 +33,6 @@ struct FileCasStrategy final : public GcStorage ~FileCasStrategy(); void Initialize(const std::filesystem::path& RootDirectory, bool IsNewStore); - CasStore::InsertResult InsertChunk(const void* ChunkData, size_t ChunkSize, const IoHash& ChunkHash); CasStore::InsertResult InsertChunk(IoBuffer Chunk, const IoHash& ChunkHash, CasStore::InsertMode Mode = CasStore::InsertMode::kMayBeMovedInPlace); @@ -46,13 +45,16 @@ struct FileCasStrategy final : public GcStorage virtual GcStorageSize StorageSize() const override { return {.DiskSize = m_TotalSize.load(std::memory_order::relaxed)}; } private: - std::filesystem::path m_RootDirectory; - RwLock m_Lock; - RwLock m_ShardLocks[256]; // TODO: these should be spaced out so they don't share cache lines - spdlog::logger& m_Log; - spdlog::logger& Log() { return m_Log; } - std::atomic_uint64_t m_TotalSize{}; - bool m_IsInitialized = false; + CasStore::InsertResult InsertChunk(const void* ChunkData, size_t ChunkSize, const IoHash& ChunkHash); + + std::filesystem::path m_RootDirectory; + RwLock m_Lock; + std::unordered_set<IoHash, IoHash::Hasher> m_KnownEntries; + RwLock m_ShardLocks[256]; // TODO: these should be spaced out so they don't share cache lines + spdlog::logger& m_Log; + spdlog::logger& Log() { return m_Log; } + std::atomic_uint64_t m_TotalSize{}; + bool m_IsInitialized = false; struct FileCasIndexEntry { |