diff --git a/connection.go b/connection.go index ba65e67b..83fd020a 100644 --- a/connection.go +++ b/connection.go @@ -168,6 +168,7 @@ func (c *Connection) Init() error { cacheSymlinks := initOp.Flags&fusekernel.InitCacheSymlinks > 0 noOpenSupport := initOp.Flags&fusekernel.InitNoOpenSupport > 0 noOpendirSupport := initOp.Flags&fusekernel.InitNoOpendirSupport > 0 + asyncDIO := initOp.Flags&fusekernel.InitAsyncDIO > 0 // Respond to the init op. initOp.Library = c.protocol @@ -183,6 +184,10 @@ func (c *Connection) Init() error { initOp.Flags |= fusekernel.InitAsyncRead } + if c.cfg.EnableAsyncDIO && asyncDIO { + initOp.Flags |= fusekernel.InitAsyncDIO + } + // kernel 4.20 increases the max from 32 -> 256 initOp.Flags |= fusekernel.InitMaxPages diff --git a/mount_config.go b/mount_config.go index f95895ad..cc2cfae4 100644 --- a/mount_config.go +++ b/mount_config.go @@ -188,10 +188,12 @@ type MountConfig struct { // 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 + // Flag to enable async buffered reads EnableAsyncReads bool + // Flag to enable async direct IO + EnableAsyncDIO bool + // Flag to enable parallel lookup and readdir operations from the // kernel // Ref: https://github.com/torvalds/linux/commit/5c672ab3f0ee0f78f7acad183f34db0f8781a200