Fixed more build errors.

geesefs-0-30-9
Aaron Jacobs 2015-07-27 15:12:43 +10:00
parent d6d4cb87c5
commit dd1fcfedf5
2 changed files with 29 additions and 4 deletions

View File

@ -91,7 +91,7 @@ type Connection struct {
type opState struct {
inMsg *buffer.InMessage
op fuseops.Op
opID uint64 // For logging
opID uint32 // For logging
}
// Create a connection wrapping the supplied file descriptor connected to the
@ -407,7 +407,7 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
}
// Convert the message to an op.
op, err := convertInMessage(m, c.protocol)
op, err = convertInMessage(m, c.protocol)
if err != nil {
err = fmt.Errorf("convertInMessage: %v", err)
return
@ -420,14 +420,14 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
c.debugLog(opID, 1, "<- %#v", op)
// Special case: handle interrupt requests inline.
if interruptOp, ok := op.(*fuseops.InternalInterruptOp); ok {
if interruptOp, ok := op.(*internalInterruptOp); ok {
c.handleInterrupt(interruptOp.FuseID)
continue
}
// Set up a context that remembers information about this op.
ctx = c.beginOp(m.Header().Opcode, m.Header().Unique)
ctx = context.WithValue(ctx, contextKey, opState{m, opID, op})
ctx = context.WithValue(ctx, contextKey, opState{m, op, opID})
// Special case: responding to statfs is required to make mounting work on
// OS X. We don't currently expose the capability for the file system to
@ -442,6 +442,14 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
}
}
// Reply to an op previously read using ReadOp, with the supplied error (or nil
// if successful). The context must be the context returned by ReadOp.
//
// LOCKS_EXCLUDED(c.mu)
func (c *Connection) Reply(ctx context.Context, err error) {
panic("TODO")
}
// Close the connection. Must not be called until operations that were read
// from the connection have been responded to.
func (c *Connection) close() (err error) {

17
ops.go
View File

@ -15,6 +15,7 @@
package fuse
import (
"fmt"
"syscall"
"unsafe"
@ -151,6 +152,22 @@ func kernelResponse(
// Internal
////////////////////////////////////////////////////////////////////////
// A sentinel used for unknown ops. The user is expected to respond with a
// non-nil error.
type unknownOp struct {
opCode uint32
inode fuseops.InodeID
}
func (o *unknownOp) ShortDesc() (desc string) {
desc = fmt.Sprintf("<opcode %d>(inode=%v)", o.opCode, o.inode)
return
}
func (o *unknownOp) DebugString() string {
return o.ShortDesc()
}
// Common implementation for our "internal" ops that don't need to be pretty.
type internalOp struct {
}