From 0513e21f9ba77521d4eccdcc10b8e3f31036a96d Mon Sep 17 00:00:00 2001 From: Siying Dong Date: Wed, 1 Feb 2017 10:19:47 -0800 Subject: [PATCH] RangeSync() should work with ROCKSDB_FALLOCATE_PRESENT not set Summary: Closes https://github.com/facebook/rocksdb/pull/1824 Differential Revision: D4493862 Pulled By: siying fbshipit-source-id: c168446 --- util/io_posix.cc | 2 +- util/io_posix.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util/io_posix.cc b/util/io_posix.cc index c108f6ec5..5c77776cb 100644 --- a/util/io_posix.cc +++ b/util/io_posix.cc @@ -755,6 +755,7 @@ Status PosixWritableFile::Allocate(uint64_t offset, uint64_t len) { return IOError(filename_, errno); } } +#endif Status PosixWritableFile::RangeSync(uint64_t offset, uint64_t nbytes) { assert(offset <= std::numeric_limits::max()); @@ -770,7 +771,6 @@ Status PosixWritableFile::RangeSync(uint64_t offset, uint64_t nbytes) { size_t PosixWritableFile::GetUniqueId(char* id, size_t max_size) const { return PosixHelper::GetUniqueIdFromFile(fd_, id, max_size); } -#endif /* * PosixRandomRWFile diff --git a/util/io_posix.h b/util/io_posix.h index f844814cf..7dd93e65a 100644 --- a/util/io_posix.h +++ b/util/io_posix.h @@ -113,9 +113,9 @@ class PosixWritableFile : public WritableFile { virtual Status InvalidateCache(size_t offset, size_t length) override; #ifdef ROCKSDB_FALLOCATE_PRESENT virtual Status Allocate(uint64_t offset, uint64_t len) override; +#endif virtual Status RangeSync(uint64_t offset, uint64_t nbytes) override; virtual size_t GetUniqueId(char* id, size_t max_size) const override; -#endif }; // mmap() based random-access