From: Adam Kupczyk Date: Fri, 26 Feb 2021 20:05:35 +0000 (+0100) Subject: os/bluestore: Add use_direct_io function X-Git-Tag: v16.2.0~35^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F40349%2Fhead;p=ceph.git os/bluestore: Add use_direct_io function Add use_direct_io() that allows rocksdb to adapt prefetch algorithms to what filesystem supports. Signed-off-by: Adam Kupczyk (cherry picked from commit 97f40a86cb79c16fa4e19d1905521e6fc677ef1d) --- diff --git a/src/os/bluestore/BlueRocksEnv.cc b/src/os/bluestore/BlueRocksEnv.cc index 6327fb1e8a32..60593ec8214e 100644 --- a/src/os/bluestore/BlueRocksEnv.cc +++ b/src/os/bluestore/BlueRocksEnv.cc @@ -137,6 +137,10 @@ class BlueRocksRandomAccessFile : public rocksdb::RandomAccessFile { h->buf.max_prefetch = fs->cct->_conf->bluefs_max_prefetch; } + bool use_direct_io() const override { + return !fs->cct->_conf->bluefs_buffered_io; + } + // Remove any kind of caching of data from the offset to offset+length // of this file. If the length is 0, then it refers to the end of file. // If the system is not caching the file contents, then this is a noop.