aboutsummaryrefslogtreecommitdiff
path: root/zenstore
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2022-04-12 14:15:37 +0200
committerDan Engelbrecht <[email protected]>2022-04-12 14:16:34 +0200
commit7947f31d84e1b45f9b777095b3f32339b89a19b9 (patch)
tree2e2cf0569a2ec14e6c90df482008e67dd75030ee /zenstore
parentswitch posix_fallocate to fallocate on MacOS (diff)
downloadzen-7947f31d84e1b45f9b777095b3f32339b89a19b9.tar.xz
zen-7947f31d84e1b45f9b777095b3f32339b89a19b9.zip
remove fallocate on MacOS
Diffstat (limited to 'zenstore')
-rw-r--r--zenstore/basicfile.cpp8
-rw-r--r--zenstore/gc.cpp5
2 files changed, 0 insertions, 13 deletions
diff --git a/zenstore/basicfile.cpp b/zenstore/basicfile.cpp
index a3e1c4f20..8eb172a1c 100644
--- a/zenstore/basicfile.cpp
+++ b/zenstore/basicfile.cpp
@@ -352,14 +352,6 @@ BasicFile::SetFileSize(uint64_t FileSize)
ThrowSystemError(Error, fmt::format("Failed to set truncate file to {} for file {}", FileSize, PathFromHandle(m_FileHandle)));
}
}
- if (FileSize > 0)
- {
- int Error = fallocate(Fd, 0, (off_t)FileSize);
- if (Error)
- {
- ThrowSystemError(Error, fmt::format("Failed to allocate space of {} for file {}", FileSize, PathFromHandle(m_FileHandle)));
- }
- }
#else
int Fd = int(intptr_t(m_FileHandle));
if (ftruncate64(Fd, (off64_t)FileSize) < 0)
diff --git a/zenstore/gc.cpp b/zenstore/gc.cpp
index 287dfb48a..856f9af02 100644
--- a/zenstore/gc.cpp
+++ b/zenstore/gc.cpp
@@ -123,11 +123,6 @@ namespace {
{
return MakeErrorCodeFromLastError();
}
- int Error = posix_fallocate(Fd, 0, (off_t)Size);
- if (Error)
- {
- return MakeErrorCode(Error);
- }
# else
if (ftruncate64(Fd, (off64_t)Size) < 0)
{