Commit 4690e804 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Dump GETATTR results too.

parent 8704b7c6
...@@ -221,14 +221,15 @@ func doRename(state *MountState, req *request) { ...@@ -221,14 +221,15 @@ func doRename(state *MountState, req *request) {
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
type operationFunc func(*MountState, *request) type operationFunc func(*MountState, *request)
type castPointerFunc func(unsafe.Pointer) interface{}
type operationHandler struct { type operationHandler struct {
Name string Name string
Func operationFunc Func operationFunc
InputSize int InputSize int
OutputSize int OutputSize int
DecodeIn func(unsafe.Pointer) interface{} DecodeIn castPointerFunc
DecodeOut func(unsafe.Pointer) interface{} DecodeOut castPointerFunc
} }
var operationHandlers []*operationHandler var operationHandlers []*operationHandler
...@@ -386,11 +387,12 @@ func init() { ...@@ -386,11 +387,12 @@ func init() {
operationHandlers[op].Func = v operationHandlers[op].Func = v
} }
operationHandlers[FUSE_LOOKUP].DecodeOut = func(ptr unsafe.Pointer) interface{} { for op, f := range map[Opcode]castPointerFunc{
return (*EntryOut)(ptr) FUSE_LOOKUP: func(ptr unsafe.Pointer) interface{} { return (*EntryOut)(ptr) },
} FUSE_OPEN: func(ptr unsafe.Pointer) interface{} { return (*EntryOut)(ptr) },
operationHandlers[FUSE_OPEN].DecodeOut = func(ptr unsafe.Pointer) interface{} { FUSE_GETATTR: func(ptr unsafe.Pointer) interface{} { return (*AttrOut)(ptr) },
return (*EntryOut)(ptr) } {
operationHandlers[op].DecodeOut = f
} }
} }
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