]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Add use_direct_io function 40349/head
authorAdam Kupczyk <akupczyk@redhat.com>
Fri, 26 Feb 2021 20:05:35 +0000 (21:05 +0100)
committerNeha Ojha <nojha@redhat.com>
Tue, 23 Mar 2021 17:20:13 +0000 (17:20 +0000)
Add use_direct_io() that allows rocksdb to adapt prefetch algorithms to what filesystem supports.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
(cherry picked from commit 97f40a86cb79c16fa4e19d1905521e6fc677ef1d)

src/os/bluestore/BlueRocksEnv.cc

index 6327fb1e8a32c88a9d9886b675f43ccc691eba7b..60593ec8214e77816b808865c6e94fcbaf046b36 100644 (file)
@@ -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.