Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion fuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,17 @@ func initMount(c *Conn, conf *mountConfig) error {
}
c.proto = proto

maxReadahead := conf.maxReadahead
if maxReadahead == 0 {
maxReadahead = defaultReadahead
}
if maxReadahead > r.MaxReadahead {
maxReadahead = r.MaxReadahead
}

s := &InitResponse{
Library: proto,
MaxReadahead: conf.maxReadahead,
MaxReadahead: maxReadahead,
MaxWrite: maxWrite,
Flags: InitBigWrites | conf.initFlags,
}
Expand Down
3 changes: 3 additions & 0 deletions fuse_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ package fuse
// 16MB value. See TestSetxattr16MB and
// https://github.com/bazil/fuse/issues/42
const maxWrite = 16 * 1024 * 1024

// Default kernel readahead.
const defaultReadahead = 128 * 1024
3 changes: 3 additions & 0 deletions fuse_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ package fuse
//
// This number is just a guess.
const maxWrite = 128 * 1024

// Default kernel readahead.
const defaultReadahead = 128 * 1024
3 changes: 3 additions & 0 deletions fuse_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ package fuse
// Linux 4.2.0 has been observed to cap this value at 128kB
// (FUSE_MAX_PAGES_PER_REQ=32, 4kB pages).
const maxWrite = 128 * 1024

// Default kernel readahead.
const defaultReadahead = 128 * 1024