]> 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)
committersdong <siying.d@fb.com>
Wed, 22 Feb 2017 23:59:17 +0000 (15:59 -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 81214cbe63363467705cb1764280e46daee5c107..cda3efe3081178e6287fef3a9bf5f1f4c548649d 100644 (file)
@@ -559,6 +559,10 @@ class ReadaheadRandomAccessFile : public RandomAccessFile {
     return file_->InvalidateCache(offset, length);
   }
 
+  virtual bool use_direct_io() const override {
+    return file_->use_direct_io();
+  }
+
  private:
   bool TryReadFromCache_(uint64_t offset, size_t n, size_t* cached_len,
                          char* scratch) const {