Commit e6656ea8 authored by Aaron Jacobs's avatar Aaron Jacobs

Use a better name.

parent 54b3ccc8
...@@ -53,7 +53,7 @@ type commonOp struct { ...@@ -53,7 +53,7 @@ type commonOp struct {
// A function that is invoked with the error given to Respond, for use in // A function that is invoked with the error given to Respond, for use in
// closing off traces and reporting back to the connection. // closing off traces and reporting back to the connection.
finish func(error) finished func(error)
} }
var gPIDMapMu sync.Mutex var gPIDMapMu sync.Mutex
...@@ -156,13 +156,13 @@ func (o *commonOp) init( ...@@ -156,13 +156,13 @@ func (o *commonOp) init(
op Op, op Op,
bazilReq bazilfuse.Request, bazilReq bazilfuse.Request,
log func(int, string, ...interface{}), log func(int, string, ...interface{}),
finish func(error)) { finished func(error)) {
// Initialize basic fields. // Initialize basic fields.
o.ctx = ctx o.ctx = ctx
o.op = op o.op = op
o.bazilReq = bazilReq o.bazilReq = bazilReq
o.log = log o.log = log
o.finish = finish o.finished = finished
// Set up a context that reflects per-PID tracing if appropriate. // Set up a context that reflects per-PID tracing if appropriate.
o.ctx = o.maybeTraceByPID(o.ctx, int(bazilReq.Hdr().Pid)) o.ctx = o.maybeTraceByPID(o.ctx, int(bazilReq.Hdr().Pid))
...@@ -172,8 +172,8 @@ func (o *commonOp) init( ...@@ -172,8 +172,8 @@ func (o *commonOp) init(
o.ctx, reportForTrace = reqtrace.StartSpan(ctx, o.op.ShortDesc()) o.ctx, reportForTrace = reqtrace.StartSpan(ctx, o.op.ShortDesc())
// When the op is finished, report to both reqtrace and the connection. // When the op is finished, report to both reqtrace and the connection.
prevFinish := o.finish prevFinish := o.finished
o.finish = func(err error) { o.finished = func(err error) {
reportForTrace(err) reportForTrace(err)
prevFinish(err) prevFinish(err)
} }
...@@ -210,7 +210,7 @@ func (o *commonOp) respondErr(err error) { ...@@ -210,7 +210,7 @@ func (o *commonOp) respondErr(err error) {
o.bazilReq.RespondError(err) o.bazilReq.RespondError(err)
// Report back to the connection that we are finished. // Report back to the connection that we are finished.
o.finish(err) o.finished(err)
} }
// Respond with the supplied response struct, which must be accepted by a // Respond with the supplied response struct, which must be accepted by a
...@@ -234,5 +234,5 @@ func (o *commonOp) respond(resp interface{}) { ...@@ -234,5 +234,5 @@ func (o *commonOp) respond(resp interface{}) {
respond.Call([]reflect.Value{reflect.ValueOf(resp)}) respond.Call([]reflect.Value{reflect.ValueOf(resp)})
// Report back to the connection that we are finished. // Report back to the connection that we are finished.
o.finish(nil) o.finished(nil)
} }
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