From 95fc8d1181111c5fea4d70bde6459f6793467f97 Mon Sep 17 00:00:00 2001 From: mcdhee-msft <89181567+mcdhee-msft@users.noreply.github.com> Date: Sat, 4 Sep 2021 21:18:39 +0530 Subject: [PATCH] Add configuration to control async reads (#105) --- .gitignore | 1 + connection.go | 5 +++++ mount_config.go | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index f23b9ea..e7c4cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ *.so # Folders +.idea/ _obj _test diff --git a/connection.go b/connection.go index ea99282..885ab49 100644 --- a/connection.go +++ b/connection.go @@ -161,6 +161,11 @@ func (c *Connection) Init() error { // Tell the kernel not to use pitifully small 4 KiB writes. initOp.Flags |= fusekernel.InitBigWrites + + if c.cfg.EnableAsyncReads { + initOp.Flags |= fusekernel.InitAsyncRead + } + // kernel 4.20 increases the max from 32 -> 256 initOp.Flags |= fusekernel.InitMaxPages initOp.MaxPages = 256 diff --git a/mount_config.go b/mount_config.go index a93c321..d23224f 100644 --- a/mount_config.go +++ b/mount_config.go @@ -174,6 +174,10 @@ type MountConfig struct { // /proc/mounts will show the filesystem type as fuse.. // If not set, /proc/mounts will show the filesystem type as fuse/fuseblk. Subtype string + + // Flag to enable async reads that are received from + // the kernel + EnableAsyncReads bool } // Create a map containing all of the key=value mount options to be given to