summaryrefslogtreecommitdiff
path: root/mount.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-08-30 09:53:36 +0200
committerJakob Unterwurzacher2021-08-30 09:53:58 +0200
commita99051b32452c9a781efe248c0014b65d4abddf7 (patch)
tree1f22221a6c0e4aa9ae3a45a05e882b0c50435a5e /mount.go
parentb83ca9c921019fc3b790dabb6198bb77ef2f9a34 (diff)
Reimplement -serialize_reads flag using new SyncRead mount flag
Let the kernel do the work for us. See https://github.com/hanwen/go-fuse/commit/15a8bb029a4e1a51e10043c370970596b1fbb737 for more info.
Diffstat (limited to 'mount.go')
-rw-r--r--mount.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/mount.go b/mount.go
index 44d5878..60ff1ba 100644
--- a/mount.go
+++ b/mount.go
@@ -273,7 +273,6 @@ func initFuseFrontend(args *argContainer) (rootNode fs.InodeEmbedder, wipeKeys f
LongNames: args.longnames,
ConfigCustom: args._configCustom,
NoPrealloc: args.noprealloc,
- SerializeReads: args.serialize_reads,
ForceDecode: args.forcedecode,
ForceOwner: args._forceOwner,
Exclude: args.exclude,
@@ -377,6 +376,14 @@ func initGoFuse(rootNode fs.InodeEmbedder, args *argContainer) *fuse.Server {
MaxWrite: fuse.MAX_KERNEL_WRITE,
Options: []string{fmt.Sprintf("max_read=%d", fuse.MAX_KERNEL_WRITE)},
Debug: args.fusedebug,
+ // The kernel usually submits multiple read requests in parallel,
+ // which means we serve them in any order. Out-of-order reads are
+ // expensive on some backing network filesystems
+ // ( https://github.com/rfjakob/gocryptfs/issues/92 ).
+ //
+ // Setting SyncRead disables FUSE_CAP_ASYNC_READ. This makes the kernel
+ // do everything in-order without parallelism.
+ SyncRead: args.serialize_reads,
}
mOpts := &fuseOpts.MountOptions