From 3f954b3056a370a686a9cb537875ef9eb14f0c55 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Wed, 29 Jul 2015 14:05:22 +1000 Subject: [PATCH] Enable async reads. As best I can tell, this instructs the kernel not to synchronize on the completion of a read request before sending further requests. This definitely means further read requests, but I believe it means any sort of request as well. It appears to make a big difference to gcsfuse read support. --- connection.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/connection.go b/connection.go index 57f36f9..1b1b246 100644 --- a/connection.go +++ b/connection.go @@ -158,7 +158,13 @@ func (c *Connection) Init() (err error) { initOp.Library = c.protocol initOp.MaxReadahead = maxReadahead initOp.MaxWrite = buffer.MaxWriteSize - initOp.Flags = fusekernel.InitBigWrites + + // Tell the kernel not to use pitifully small 4 KiB writes. + initOp.Flags |= fusekernel.InitBigWrites + + // Tell the kernel it is free to send further requests while a read request + // is in flight. + initOp.Flags |= fusekernel.InitAsyncRead c.Reply(ctx, nil) return