Commit 9ae6c46a authored by Nick Craig-Wood's avatar Nick Craig-Wood Committed by Han-Wen Nienhuys

Allow MaxReadAhead to be set - fixes #139

parent 6c2b7d8f
...@@ -43,6 +43,10 @@ type MountOptions struct { ...@@ -43,6 +43,10 @@ type MountOptions struct {
// capped at the kernel maximum. // capped at the kernel maximum.
MaxWrite int MaxWrite int
// Max read ahead to use. If 0, use default. This number is
// capped at the kernel maximum.
MaxReadAhead int
// If IgnoreSecurityLabels is set, all security related xattr // If IgnoreSecurityLabels is set, all security related xattr
// requests will return NO_DATA without passing through the // requests will return NO_DATA without passing through the
// user defined filesystem. You should only set this if you // user defined filesystem. You should only set this if you
......
...@@ -99,6 +99,9 @@ func doInit(server *Server, req *request) { ...@@ -99,6 +99,9 @@ func doInit(server *Server, req *request) {
CongestionThreshold: uint16(server.opts.MaxBackground * 3 / 4), CongestionThreshold: uint16(server.opts.MaxBackground * 3 / 4),
MaxBackground: uint16(server.opts.MaxBackground), MaxBackground: uint16(server.opts.MaxBackground),
} }
if server.opts.MaxReadAhead != 0 && uint32(server.opts.MaxReadAhead) < out.MaxReadAhead {
out.MaxReadAhead = uint32(server.opts.MaxReadAhead)
}
if out.Minor > input.Minor { if out.Minor > input.Minor {
out.Minor = input.Minor out.Minor = input.Minor
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment