From 6450a1cbbf652709b5a6b38a8a8b9a00829f6072 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Thu, 6 Aug 2015 15:45:40 +1000 Subject: [PATCH] Added special cases for ReadFile and WriteFile. --- debug.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/debug.go b/debug.go index c51a399..2003fc0 100644 --- a/debug.go +++ b/debug.go @@ -18,6 +18,8 @@ import ( "fmt" "reflect" "strings" + + "github.com/jacobsa/fuse/fuseops" ) // Decide on the name of the given op. @@ -47,6 +49,16 @@ func describeRequest(op interface{}) (s string) { switch typed := op.(type) { case *interruptOp: addComponent("fuseid 0x%08x", typed.FuseID) + + case *fuseops.ReadFileOp: + addComponent("handle %d", typed.Handle) + addComponent("offset %d", typed.Offset) + addComponent("%d bytes", len(typed.Dst)) + + case *fuseops.WriteFileOp: + addComponent("handle %d", typed.Handle) + addComponent("offset %d", typed.Offset) + addComponent("%d bytes", len(typed.Data)) } // Use just the name if there is no extra info.