Skip to content

Commit

Permalink
add use_direct_io() to ReadaheadRandomAccessFile
Browse files Browse the repository at this point in the history
Summary:
Missing this function will cause RandomAccessFileReader not doing alignment in Direct IO mode, which introduce an IOError: invalid argument.
Closes #1900

Differential Revision: D4601261

Pulled By: lightmark

fbshipit-source-id: c3eadf1
  • Loading branch information
lightmark committed Feb 24, 2017
1 parent 6fa0404 commit a3576c7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions util/file_reader_writer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down

0 comments on commit a3576c7

Please sign in to comment.