aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-04-01 22:47:46 +0200
committerDan Engelbrecht <[email protected]>2022-04-01 22:47:46 +0200
commite51efe1674fa3d9d4af715d85a4045e1ee7450f3 (patch)
tree7d7fc4ad33fdd36e5d97719895984f83adb09957
parentlinux fixes (diff)
downloadzen-e51efe1674fa3d9d4af715d85a4045e1ee7450f3.tar.xz
zen-e51efe1674fa3d9d4af715d85a4045e1ee7450f3.zip
linux compilation fixes
-rw-r--r--zenserver/cache/structuredcachestore.cpp2
-rw-r--r--zenstore/compactcas.cpp16
-rw-r--r--zenstore/gc.cpp8
-rw-r--r--zenstore/include/zenstore/caslog.h2
4 files changed, 9 insertions, 19 deletions
diff --git a/zenserver/cache/structuredcachestore.cpp b/zenserver/cache/structuredcachestore.cpp
index 79bb8486e..6b448b8d2 100644
--- a/zenserver/cache/structuredcachestore.cpp
+++ b/zenserver/cache/structuredcachestore.cpp
@@ -61,8 +61,8 @@ SaveCompactBinaryObject(const fs::path& Path, const CbObject& Object)
ZenCacheStore::ZenCacheStore(CasGc& Gc, const std::filesystem::path& RootDir)
: GcStorage(Gc)
-, m_RootDir(RootDir)
, GcContributor(Gc)
+, m_RootDir(RootDir)
, m_DiskLayer(RootDir)
{
ZEN_INFO("initializing structured cache at '{}'", RootDir);
diff --git a/zenstore/compactcas.cpp b/zenstore/compactcas.cpp
index c424cde74..7e52f31db 100644
--- a/zenstore/compactcas.cpp
+++ b/zenstore/compactcas.cpp
@@ -1170,7 +1170,7 @@ CasContainerStrategy::CollectGarbage(GcContext& GcCtx)
if (!NewBlockFile || (WriteOffset + Chunk.size() > m_MaxBlockSize))
{
- uint32_t NextBlockIndex = m_WriteBlockIndex.load(std::memory_order::memory_order_relaxed);
+ uint32_t NextBlockIndex = m_WriteBlockIndex.load(std::memory_order_relaxed);
std::vector<CasDiskIndexEntry> LogEntries = MakeCasDiskEntries(MovedBlockChunks, {});
m_CasLog.Append(LogEntries);
m_CasLog.Flush();
@@ -2398,7 +2398,7 @@ TEST_CASE("compactcas.threadedinsert") // * doctest::skip(true))
}
}
std::vector<IoHash> KeepHashes(GcChunkHashes.begin(), GcChunkHashes.end());
- int32_t C = 0;
+ size_t C = 0;
while (C < KeepHashes.size())
{
if (C % 155 == 0)
@@ -2445,7 +2445,7 @@ TEST_CASE("compactcas.threadedinsert") // * doctest::skip(true))
}
}
std::vector<IoHash> KeepHashes(GcChunkHashes.begin(), GcChunkHashes.end());
- int32_t C = 0;
+ size_t C = 0;
while (C < KeepHashes.size())
{
if (C % 77 == 0 && C < KeepHashes.size() - 1)
@@ -2482,16 +2482,6 @@ TEST_CASE("compactcas.threadedinsert") // * doctest::skip(true))
TEST_CASE("compactcas.migrate.large.data" * doctest::skip(true))
{
- auto getChunkSet = [](const std::vector<CasDiskIndexEntry>& Entries) {
- std::unordered_set<IoHash, IoHash::Hasher> ChunkHashes;
- ChunkHashes.reserve(Entries.size());
- for (const auto& Entry : Entries)
- {
- ChunkHashes.insert(Entry.Key);
- }
- return ChunkHashes;
- };
-
const char* BigDataPath = "D:\\zen-data\\dc4-zen-cache-t\\cas";
std::filesystem::path TobsBasePath = GetBasePath(BigDataPath, "tobs");
std::filesystem::path SobsBasePath = GetBasePath(BigDataPath, "sobs");
diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp
index a37fc2f5b..a86bae143 100644
--- a/zenstore/gc.cpp
+++ b/zenstore/gc.cpp
@@ -119,20 +119,20 @@ namespace {
}
# if ZEN_PLATFORM_MAC
- if (ftruncate(Fd, (off_t)FileSize) < 0)
+ if (ftruncate(Fd, (off_t)Size) < 0)
{
return zen::MakeErrorCodeFromLastError();
}
- if (posix_fallocate(Fd, 0, (off_t)FileSize) < 0)
+ if (posix_fallocate(Fd, 0, (off_t)Size) < 0)
{
return zen::MakeErrorCodeFromLastError();
}
# else
- if (ftruncate64(Fd, (off64_t)FileSize) < 0)
+ if (ftruncate64(Fd, (off64_t)Size) < 0)
{
return zen::MakeErrorCodeFromLastError();
}
- if (posix_fallocate64(Fd, 0, (off64_t)FileSize) < 0)
+ if (posix_fallocate64(Fd, 0, (off64_t)Size) < 0)
{
return zen::MakeErrorCodeFromLastError();
}
diff --git a/zenstore/include/zenstore/caslog.h b/zenstore/include/zenstore/caslog.h
index 148837e35..66e2058f6 100644
--- a/zenstore/include/zenstore/caslog.h
+++ b/zenstore/include/zenstore/caslog.h
@@ -83,7 +83,7 @@ public:
CasLogFile::Append(&Record, sizeof Record);
}
- void Append(const std::span<T>& Records) { CasLogFile::Append(Records.data(), (sizeof T) * Records.size()); }
+ void Append(const std::span<T>& Records) { CasLogFile::Append(Records.data(), sizeof (T) * Records.size()); }
};
} // namespace zen