Skip to content
Closed
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
5 changes: 1 addition & 4 deletions fuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ func initMount(c *Conn, conf *mountConfig) error {
s := &InitResponse{
Library: proto,
MaxReadahead: conf.maxReadahead,
MaxWrite: 128 * 1024,
MaxWrite: maxWrite,
Flags: InitBigWrites | conf.initFlags,
}
r.Respond(s)
Expand Down Expand Up @@ -403,9 +403,6 @@ func (h *Header) RespondError(err error) {
h.respond(buf)
}

// Maximum file write size we are prepared to receive from the kernel.
const maxWrite = 16 * 1024 * 1024

// All requests read from the kernel, without data, are shorter than
// this.
var maxRequestSize = syscall.Getpagesize()
Expand Down
5 changes: 5 additions & 0 deletions mount_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import (
"syscall"
)

// OS X appears to cap the size of writes to 1 MiB. This constant is also used
// for sizing receive buffers, so make it as small as it can be without
// limiting write sizes.
const maxWrite = 1 << 20

var (
errNoAvail = errors.New("no available fuse devices")
errNotLoaded = errors.New("osxfuse is not loaded")
Expand Down
3 changes: 3 additions & 0 deletions mount_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ import (
"syscall"
)

// Maximum file write size we are prepared to receive from the kernel.
const maxWrite = 128 * 1024

func handleMountFusefsStderr(errCh chan<- error) func(line string) (ignore bool) {
return func(line string) (ignore bool) {
const (
Expand Down
4 changes: 4 additions & 0 deletions mount_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import (
"syscall"
)

// Maximum file write size we are prepared to receive from the kernel. Linux
// appears to limit writes to 128 KiB.
const maxWrite = 128 * 1024

func handleFusermountStderr(errCh chan<- error) func(line string) (ignore bool) {
return func(line string) (ignore bool) {
if line == `fusermount: failed to open /etc/fuse.conf: Permission denied` {
Expand Down