Add configuration to control async reads (#105)

zerocopy-examples
mcdhee-msft 2021-09-04 21:18:39 +05:30 committed by GitHub
parent 10d864429b
commit 95fc8d1181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 0 deletions

1
.gitignore vendored
View File

@ -7,6 +7,7 @@
*.so *.so
# Folders # Folders
.idea/
_obj _obj
_test _test

View File

@ -161,6 +161,11 @@ func (c *Connection) Init() error {
// Tell the kernel not to use pitifully small 4 KiB writes. // Tell the kernel not to use pitifully small 4 KiB writes.
initOp.Flags |= fusekernel.InitBigWrites initOp.Flags |= fusekernel.InitBigWrites
if c.cfg.EnableAsyncReads {
initOp.Flags |= fusekernel.InitAsyncRead
}
// kernel 4.20 increases the max from 32 -> 256 // kernel 4.20 increases the max from 32 -> 256
initOp.Flags |= fusekernel.InitMaxPages initOp.Flags |= fusekernel.InitMaxPages
initOp.MaxPages = 256 initOp.MaxPages = 256

View File

@ -174,6 +174,10 @@ type MountConfig struct {
// /proc/mounts will show the filesystem type as fuse.<Subtype>. // /proc/mounts will show the filesystem type as fuse.<Subtype>.
// If not set, /proc/mounts will show the filesystem type as fuse/fuseblk. // If not set, /proc/mounts will show the filesystem type as fuse/fuseblk.
Subtype string 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 // Create a map containing all of the key=value mount options to be given to