]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Add use_direct_io function 39729/head
authorAdam Kupczyk <akupczyk@redhat.com>
Fri, 26 Feb 2021 20:05:35 +0000 (21:05 +0100)
committerAdam Kupczyk <akupczyk@redhat.com>
Fri, 26 Feb 2021 20:11:12 +0000 (21:11 +0100)
Add use_direct_io() that allows rocksdb to adapt prefetch algorithms to what filesystem supports.

Signed-off-by: Adam Kupczyk <akupczyk@redhat.com>
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.