Add configuration to control async reads (#105)

zerocopy-examples
mcdhee-msft 1 year ago committed by GitHub
parent 10d864429b
commit 95fc8d1181
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 5
      connection.go
  3. 4
      mount_config.go

1
.gitignore vendored

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

@ -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

@ -174,6 +174,10 @@ type MountConfig struct {
// /proc/mounts will show the filesystem type as fuse.<Subtype>.
// 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

Loading…
Cancel
Save