Fix OSX build break after the fallocate change

Summary:
The recent update about fallocate failed OSX build. Fix it.
Closes https://github.com/facebook/rocksdb/pull/1830

Differential Revision: D4500235

Pulled By: siying

fbshipit-source-id: a5f2b40
main
Siying Dong 8 years ago committed by Facebook Github Bot
parent 4a3e7d320c
commit f289d9f4ac
  1. 2
      util/io_posix.cc
  2. 2
      util/io_posix.h

@ -757,6 +757,7 @@ Status PosixWritableFile::Allocate(uint64_t offset, uint64_t len) {
} }
#endif #endif
#ifdef OS_LINUX
Status PosixWritableFile::RangeSync(uint64_t offset, uint64_t nbytes) { Status PosixWritableFile::RangeSync(uint64_t offset, uint64_t nbytes) {
assert(offset <= std::numeric_limits<off_t>::max()); assert(offset <= std::numeric_limits<off_t>::max());
assert(nbytes <= std::numeric_limits<off_t>::max()); assert(nbytes <= std::numeric_limits<off_t>::max());
@ -771,6 +772,7 @@ Status PosixWritableFile::RangeSync(uint64_t offset, uint64_t nbytes) {
size_t PosixWritableFile::GetUniqueId(char* id, size_t max_size) const { size_t PosixWritableFile::GetUniqueId(char* id, size_t max_size) const {
return PosixHelper::GetUniqueIdFromFile(fd_, id, max_size); return PosixHelper::GetUniqueIdFromFile(fd_, id, max_size);
} }
#endif
/* /*
* PosixRandomRWFile * PosixRandomRWFile

@ -114,8 +114,10 @@ class PosixWritableFile : public WritableFile {
#ifdef ROCKSDB_FALLOCATE_PRESENT #ifdef ROCKSDB_FALLOCATE_PRESENT
virtual Status Allocate(uint64_t offset, uint64_t len) override; virtual Status Allocate(uint64_t offset, uint64_t len) override;
#endif #endif
#ifdef OS_LINUX
virtual Status RangeSync(uint64_t offset, uint64_t nbytes) override; virtual Status RangeSync(uint64_t offset, uint64_t nbytes) override;
virtual size_t GetUniqueId(char* id, size_t max_size) const override; virtual size_t GetUniqueId(char* id, size_t max_size) const override;
#endif
}; };
// mmap() based random-access // mmap() based random-access

Loading…
Cancel
Save