Commit dd1fcfed authored by Aaron Jacobs's avatar Aaron Jacobs

Fixed more build errors.

parent d6d4cb87
...@@ -91,7 +91,7 @@ type Connection struct { ...@@ -91,7 +91,7 @@ type Connection struct {
type opState struct { type opState struct {
inMsg *buffer.InMessage inMsg *buffer.InMessage
op fuseops.Op op fuseops.Op
opID uint64 // For logging opID uint32 // For logging
} }
// Create a connection wrapping the supplied file descriptor connected to the // 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) { ...@@ -407,7 +407,7 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
} }
// Convert the message to an op. // Convert the message to an op.
op, err := convertInMessage(m, c.protocol) op, err = convertInMessage(m, c.protocol)
if err != nil { if err != nil {
err = fmt.Errorf("convertInMessage: %v", err) err = fmt.Errorf("convertInMessage: %v", err)
return return
...@@ -420,14 +420,14 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) { ...@@ -420,14 +420,14 @@ func (c *Connection) ReadOp() (ctx context.Context, op fuseops.Op, err error) {
c.debugLog(opID, 1, "<- %#v", op) c.debugLog(opID, 1, "<- %#v", op)
// Special case: handle interrupt requests inline. // Special case: handle interrupt requests inline.
if interruptOp, ok := op.(*fuseops.InternalInterruptOp); ok { if interruptOp, ok := op.(*internalInterruptOp); ok {
c.handleInterrupt(interruptOp.FuseID) c.handleInterrupt(interruptOp.FuseID)
continue continue
} }
// Set up a context that remembers information about this op. // Set up a context that remembers information about this op.
ctx = c.beginOp(m.Header().Opcode, m.Header().Unique) 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 // 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 // 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) { ...@@ -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 // Close the connection. Must not be called until operations that were read
// from the connection have been responded to. // from the connection have been responded to.
func (c *Connection) close() (err error) { func (c *Connection) close() (err error) {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
package fuse package fuse
import ( import (
"fmt"
"syscall" "syscall"
"unsafe" "unsafe"
...@@ -151,6 +152,22 @@ func kernelResponse( ...@@ -151,6 +152,22 @@ func kernelResponse(
// Internal // 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. // Common implementation for our "internal" ops that don't need to be pretty.
type internalOp struct { type internalOp struct {
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment