Commit 5f1423b7 authored by Jakob Unterwurzacher's avatar Jakob Unterwurzacher

fuse: improve pretty-printing for LOOKUP, BATCH_FORGET and LINK

LOOKUP is changed to use the human-readable "NodeId: %d" output
that is used in most other places. This also makes grepping easier.

Also adds debug output for batch forget.

Change-Id: I086b4c34b17c98b7df474e90cf9b8b493ac9e040
parent 259481ac
......@@ -251,7 +251,10 @@ func doBatchForget(server *Server, req *request) {
}
forgets := *(*[]_ForgetOne)(unsafe.Pointer(h))
for _, f := range forgets {
for i, f := range forgets {
if server.debug {
log.Printf("doBatchForget: forgetting %d of %d: NodeId: %d, Nlookup: %d", i+1, len(forgets), f.NodeId, f.Nlookup)
}
server.fileSystem.Forget(f.NodeId, f.Nlookup)
}
}
......
......@@ -196,13 +196,13 @@ func (me *AttrOut) string() string {
}
func (me *EntryOut) string() string {
return fmt.Sprintf("{%d G%d E%d.%09d A%d.%09d %v}",
me.NodeId, me.Generation, me.EntryValid, me.EntryValidNsec,
me.AttrValid, me.AttrValidNsec, &me.Attr)
return fmt.Sprintf("{NodeId: %d Generation=%d EntryValid=%d.%03d AttrValid=%d.%03d Attr=%v}",
me.NodeId, me.Generation, me.EntryValid, me.EntryValidNsec/1000000,
me.AttrValid, me.AttrValidNsec/1000000, &me.Attr)
}
func (me *CreateOut) string() string {
return fmt.Sprintf("{%v %v}", &me.EntryOut, &me.OpenOut)
return fmt.Sprintf("{NodeId: %d Generation=%d %v %v}", me.NodeId, me.Generation, &me.EntryOut, &me.OpenOut)
}
func (me *StatfsOut) string() string {
......@@ -229,6 +229,10 @@ func (f *FallocateIn) string() string {
f.Fh, f.Offset, f.Length, f.Mode)
}
func (f *LinkIn) string() string {
return fmt.Sprintf("{Oldnodeid: %d}", f.Oldnodeid)
}
// Print pretty prints FUSE data types for kernel communication
func Print(obj interface{}) string {
t, ok := obj.(interface {
......
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