Fixed package fuse.

geesefs-0-30-9
Aaron Jacobs 2015-07-27 15:43:41 +10:00
parent e59dbd14f4
commit 3755e3c1a1
3 changed files with 7 additions and 8 deletions

View File

@ -26,7 +26,6 @@ import (
"golang.org/x/net/context"
"github.com/jacobsa/fuse/fuseops"
"github.com/jacobsa/fuse/internal/buffer"
"github.com/jacobsa/fuse/internal/fusekernel"
)
@ -90,7 +89,7 @@ type Connection struct {
// context that the user uses to reply to the op.
type opState struct {
inMsg *buffer.InMessage
op fuseops.Op
op interface{}
opID uint32 // For logging
}
@ -396,7 +395,7 @@ func (c *Connection) writeMessage(msg []byte) (err error) {
// /dev/fuse. It must not be called multiple times concurrently.
//
// LOCKS_EXCLUDED(c.mu)
func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
func (c *Connection) ReadOp() (ctx context.Context, op interface{}, err error) {
// Keep going until we find a request we know how to convert.
for {
// Read the next message from the kernel.

View File

@ -27,13 +27,13 @@ import (
"github.com/jacobsa/fuse/internal/fusekernel"
)
// Convert a kernel message to an appropriate implementation of fuseops.Op. If
// the op is unknown, a special unexported type will be used.
// Convert a kernel message to an appropriate op. If the op is unknown, a
// special unexported type will be used.
//
// The caller is responsible for arranging for the message to be destroyed.
func convertInMessage(
m *buffer.InMessage,
protocol fusekernel.Protocol) (o fuseops.Op, err error) {
protocol fusekernel.Protocol) (o interface{}, err error) {
switch m.Header().Opcode {
case fusekernel.OpLookup:
buf := m.ConsumeBytes(m.Len())

4
ops.go
View File

@ -28,7 +28,7 @@ import (
// response, return a nil response.
func kernelResponse(
fuseID uint64,
op fuseops.Op,
op interface{},
opErr error,
protocol fusekernel.Protocol) (msg []byte) {
// If the user replied with an error, create room enough just for the result
@ -59,7 +59,7 @@ func kernelResponse(
// Like kernelResponse, but assumes the user replied with a nil error to the
// op.
func kernelResponseForOp(
op fuseops.Op,
op interface{},
protocol fusekernel.Protocol) (b buffer.OutMessage) {
// Create the appropriate output message
switch o := op.(type) {