From d93a81b046e4eb1b48559bec350b25d763847ccd Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 24 Jul 2015 14:46:45 +1000 Subject: [PATCH] Defined the constant for Linux, too. --- internal/buffer/in_message_darwin.go | 3 ++- internal/buffer/in_message_linux.go | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 internal/buffer/in_message_linux.go diff --git a/internal/buffer/in_message_darwin.go b/internal/buffer/in_message_darwin.go index d1f6b9f..af37a02 100644 --- a/internal/buffer/in_message_darwin.go +++ b/internal/buffer/in_message_darwin.go @@ -16,5 +16,6 @@ package buffer // The maximum fuse write request size that InMessage can acommodate. // -// Experimentally, OS X appears to cap the size of writes to 1 MiB. +// Experimentally, OS X appears to cap the size of writes to 1 MiB, regardless +// of whether a larger size is specified in the mount options. const MaxWriteSize = 1 << 20 diff --git a/internal/buffer/in_message_linux.go b/internal/buffer/in_message_linux.go new file mode 100644 index 0000000..964c7da --- /dev/null +++ b/internal/buffer/in_message_linux.go @@ -0,0 +1,21 @@ +// Copyright 2015 Google Inc. All Rights Reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package buffer + +// The maximum fuse write request size that InMessage can acommodate. +// +// Experimentally, Linux appears to refuse to honor a MaxWrite setting in an +// INIT response of more than 128 KiB. +const MaxWriteSize = 1 << 17