]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commitdiff
add use_direct_io() to ReadaheadRandomAccessFile
authorAaron Gao <gzh@fb.com>
Wed, 22 Feb 2017 22:48:09 +0000 (14:48 -0800)
committerAaron Gao <gzh@fb.com>
Fri, 24 Feb 2017 00:44:30 +0000 (16:44 -0800)
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

index 877d48b2506a7fe3c81362ad8b5bb7b53ece8d63..e68ff4676a2a09469bfe4182ae0e61ab0a5a56d7 100644 (file)
@@ -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<RandomAccessFile> file_;
   size_t               readahead_size_;