From a3576c7c4b3d57af73a2e0a2ea18ff60716bd567 Mon Sep 17 00:00:00 2001 From: Aaron Gao Date: Wed, 22 Feb 2017 14:48:09 -0800 Subject: [PATCH] add use_direct_io() to ReadaheadRandomAccessFile Summary: Missing this function will cause RandomAccessFileReader not doing alignment in Direct IO mode, which introduce an IOError: invalid argument. Closes https://github.com/facebook/rocksdb/pull/1900 Differential Revision: D4601261 Pulled By: lightmark fbshipit-source-id: c3eadf1 --- util/file_reader_writer.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/file_reader_writer.cc b/util/file_reader_writer.cc index 877d48b25..e68ff4676 100644 --- a/util/file_reader_writer.cc +++ b/util/file_reader_writer.cc @@ -543,6 +543,10 @@ class ReadaheadRandomAccessFile : public RandomAccessFile { return file_->InvalidateCache(offset, length); } + virtual bool use_direct_io() const override { + return file_->use_direct_io(); + } + private: std::unique_ptr file_; size_t readahead_size_;