From 2fa4c6e7bc34478109c0678a5228c41aa4698929 Mon Sep 17 00:00:00 2001 From: Adam Kupczyk Date: Fri, 26 Feb 2021 21:05:35 +0100 Subject: [PATCH] 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) --- src/os/bluestore/BlueRocksEnv.cc | 4 ++++ 1 file changed, 4 insertions(+) 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. -- 2.47.3