Commit 36e4dd83 authored by Aaron Jacobs's avatar Aaron Jacobs

commonOp.ShortDesc

parent a2c287f9
...@@ -66,7 +66,8 @@ type commonOp struct { ...@@ -66,7 +66,8 @@ type commonOp struct {
} }
func (o *commonOp) ShortDesc() (desc string) { func (o *commonOp) ShortDesc() (desc string) {
opName := reflect.TypeOf(o.op).String() v := reflect.ValueOf(o.op)
opName := v.Type().String()
// Attempt to better handle the usual case: a string that looks like // Attempt to better handle the usual case: a string that looks like
// "*fuseops.GetInodeAttributesOp". // "*fuseops.GetInodeAttributesOp".
...@@ -76,8 +77,10 @@ func (o *commonOp) ShortDesc() (desc string) { ...@@ -76,8 +77,10 @@ func (o *commonOp) ShortDesc() (desc string) {
opName = opName[len(prefix) : len(opName)-len(suffix)] opName = opName[len(prefix) : len(opName)-len(suffix)]
} }
// Include the inode number to which the op applies. // Include the inode number to which the op applies, if possible.
desc = fmt.Sprintf("%s(inode=%v)", opName, o.bazilReq.Hdr().Node) if f := v.FieldByName("Inode"); f.IsValid() {
desc = fmt.Sprintf("%s(inode=%v)", opName, f.Interface())
}
return return
} }
......
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