Redefined the contents of OutMessage.
parent
2d3078f8b9
commit
3371ab70ac
|
@ -21,14 +21,18 @@ import (
|
|||
"github.com/jacobsa/fuse/internal/fusekernel"
|
||||
)
|
||||
|
||||
// We size out messages to be large enough to hold a header for the response
|
||||
// plus the largest read that may come in.
|
||||
const outMessageSize = unsafe.Sizeof(fusekernel.OutHeader{}) + MaxReadSize
|
||||
|
||||
// OutMessage provides a mechanism for constructing a single contiguous fuse
|
||||
// message from multiple segments, where the first segment is always a
|
||||
// fusekernel.OutHeader message.
|
||||
//
|
||||
// Must be created with NewOutMessage. Exception: the zero value has
|
||||
// Bytes() == nil.
|
||||
// Must be initialized with Reset.
|
||||
type OutMessage struct {
|
||||
slice []byte
|
||||
offset uintptr
|
||||
storage [outMessageSize]byte
|
||||
}
|
||||
|
||||
// Create a new buffer whose initial contents are a zeroed fusekernel.OutHeader
|
||||
|
|
|
@ -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 read size that we expect to ever see from the kernel, used for
|
||||
// calculating the size of out messages.
|
||||
//
|
||||
// Experimentally determined on OS X.
|
||||
const MaxReadSize = 1 << 20
|
Loading…
Reference in New Issue