Commit ae0f3969 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 2332f049
......@@ -751,6 +751,7 @@ func init() {
_OP_MKNOD: func(ptr unsafe.Pointer) interface{} { return (*MknodIn)(ptr) },
_OP_CREATE: func(ptr unsafe.Pointer) interface{} { return (*CreateIn)(ptr) },
_OP_READ: func(ptr unsafe.Pointer) interface{} { return (*ReadIn)(ptr) },
_OP_WRITE: func(ptr unsafe.Pointer) interface{} { return (*WriteIn)(ptr) },
_OP_READDIR: func(ptr unsafe.Pointer) interface{} { return (*ReadIn)(ptr) },
_OP_ACCESS: func(ptr unsafe.Pointer) interface{} { return (*AccessIn)(ptr) },
_OP_FORGET: func(ptr unsafe.Pointer) interface{} { return (*ForgetIn)(ptr) },
......
......@@ -60,10 +60,16 @@ func (in *ReadIn) string() string {
}
func (in *WriteIn) string() string {
// TODO Lx optional - only if WRITE_LOCKOWNER is set
return fmt.Sprintf("{h%d [%d +%d) %s L%d %s}",
in.Fh, in.Offset, in.Size,
flagString(writeFlagNames, int64(in.WriteFlags), ""),
in.LockOwner,
flagString(openFlagNames, int64(in.Flags), "RDONLY"))
// δ: `Fh X` -> hX; Lx optional - only if WRITE_LOCKOWNER is set
s := fmt.Sprintf("{h%d [%d +%d)", in.Fh, in.Offset, in.Size)
wflags := in.WriteFlags &^ WRITE_LOCKOWNER
if wflags != 0 {
s += " " + flagString(writeFlagNames, int64(wflags), "")
}
s += " " + flagString(openFlagNames, int64(in.Flags), "RDONLY")
if in.WriteFlags & WRITE_LOCKOWNER != 0 {
s += fmt.Sprintf(" L%x", in.LockOwner)
}
s += "}"
return s
}
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