Use new beginOp/finishOp.
parent
365f219704
commit
4fdecd8417
|
@ -109,12 +109,12 @@ func (c *Connection) finishOp(reqID bazilfuse.RequestID) {
|
||||||
// This function delivers ops in exactly the order they are received from
|
// This function delivers ops in exactly the order they are received from
|
||||||
// /dev/fuse. It must not be called multiple times concurrently.
|
// /dev/fuse. It must not be called multiple times concurrently.
|
||||||
func (c *Connection) ReadOp() (op fuseops.Op, err error) {
|
func (c *Connection) ReadOp() (op fuseops.Op, err error) {
|
||||||
var bfReq bazilfuse.Request
|
|
||||||
|
|
||||||
// Keep going until we find a request we know how to convert.
|
// Keep going until we find a request we know how to convert.
|
||||||
for {
|
for {
|
||||||
// Read a bazilfuse request.
|
// Read a bazilfuse request.
|
||||||
|
var bfReq bazilfuse.Request
|
||||||
bfReq, err = c.wrapped.ReadRequest()
|
bfReq, err = c.wrapped.ReadRequest()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -135,15 +135,17 @@ func (c *Connection) ReadOp() (op fuseops.Op, err error) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert it.
|
// Set up op dependencies.
|
||||||
|
var reqID bazilfuse.RequestID = bfReq.Hdr().ID
|
||||||
|
opCtx := c.beginOp(reqID)
|
||||||
|
|
||||||
logForOp := func(calldepth int, format string, v ...interface{}) {
|
logForOp := func(calldepth int, format string, v ...interface{}) {
|
||||||
c.log(opID, calldepth+1, format, v...)
|
c.log(opID, calldepth+1, format, v...)
|
||||||
}
|
}
|
||||||
|
|
||||||
finished := func(err error) { c.finishOp() }
|
finished := func(err error) { c.finishOp(reqID) }
|
||||||
|
|
||||||
op = fuseops.Convert(c.parentCtx, bfReq, logForOp, finished)
|
op = fuseops.Convert(opCtx, bfReq, logForOp, finished)
|
||||||
c.beginOp()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue