From a9671d26ce09ee0e0df7a3b482141bdb29471897 Mon Sep 17 00:00:00 2001 From: luke-lombardi <33990301+luke-lombardi@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:46:33 -0500 Subject: [PATCH 1/2] enable direct io --- pkg/blobfs_node.go | 6 +++++- pkg/types.go | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/blobfs_node.go b/pkg/blobfs_node.go index bb793a2..99db0e9 100644 --- a/pkg/blobfs_node.go +++ b/pkg/blobfs_node.go @@ -149,7 +149,11 @@ func (n *FSNode) Opendir(ctx context.Context) syscall.Errno { func (n *FSNode) Open(ctx context.Context, flags uint32) (fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno) { n.log("Open called with flags: %v", flags) - return nil, 0, fs.OK + if n.filesystem.Config.BlobFs.DirectIO { + flags |= fuse.FOPEN_DIRECT_IO + } + + return nil, flags, fs.OK } func (n *FSNode) Read(ctx context.Context, f fs.FileHandle, dest []byte, off int64) (fuse.ReadResult, syscall.Errno) { diff --git a/pkg/types.go b/pkg/types.go index d1053b6..b15e426 100644 --- a/pkg/types.go +++ b/pkg/types.go @@ -95,6 +95,7 @@ type BlobFsConfig struct { Sources []SourceConfig `key:"sources" json:"sources"` MaxBackgroundTasks int `key:"maxBackgroundTasks" json:"max_background_tasks"` MaxReadAheadKB int `key:"maxReadAheadKB" json:"max_read_ahead_kb"` + DirectIO bool `key:"directIO" json:"direct_io"` } type SourceConfig struct { From 2a181dfda3915ece2197dc8dfe0df7487ce7425d Mon Sep 17 00:00:00 2001 From: luke-lombardi <33990301+luke-lombardi@users.noreply.github.com> Date: Thu, 5 Dec 2024 14:48:12 -0500 Subject: [PATCH 2/2] set directio to false by default --- pkg/config.default.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/config.default.yaml b/pkg/config.default.yaml index df8210d..4f2a4a3 100644 --- a/pkg/config.default.yaml +++ b/pkg/config.default.yaml @@ -9,6 +9,7 @@ grpcMessageSizeBytes: 1000000000 grpcDialTimeoutS: 1 discoveryIntervalS: 5 discoveryMode: metadata +directIO: false blobfs: enabled: false mountPoint: /tmp/test