Commit c9da078c authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Reinstate file name printing in debug mode.

parent 88ab347f
......@@ -292,10 +292,15 @@ func (me *MountState) handle(req *request) {
func (me *MountState) dispatch(req *request, handler *operationHandler) {
if me.Debug {
nm := ""
// TODO - reinstate filename printing.
log.Printf("Dispatch: %v, NodeId: %v %s\n",
operationName(req.inHeader.Opcode), req.inHeader.NodeId, nm)
handler := getHandler(req.inHeader.Opcode)
var names interface{}
if handler.FileNames > 0 {
names = req.filenames(handler.FileNames)
} else {
names = ""
}
log.Printf("Dispatch: %v, NodeId: %v %v\n",
operationName(req.inHeader.Opcode), req.inHeader.NodeId, names)
}
handler.Func(me, req)
}
......
......@@ -260,6 +260,7 @@ type operationHandler struct {
OutputSize int
DecodeIn castPointerFunc
DecodeOut castPointerFunc
FileNames int
}
var operationHandlers []*operationHandler
......@@ -425,4 +426,18 @@ func init() {
operationHandlers[op].DecodeOut = f
}
for op, count := range map[Opcode]int {
FUSE_LOOKUP: 1,
FUSE_RENAME: 2,
FUSE_SYMLINK: 2,
FUSE_GETXATTR: 1,
FUSE_CREATE: 1,
FUSE_MKNOD: 1,
FUSE_MKDIR: 1,
FUSE_UNLINK: 1,
FUSE_RMDIR: 1,
FUSE_REMOVEXATTR: 1,
} {
operationHandlers[op].FileNames = count
}
}
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