Embed the bazilfuse response object within ReadFileOp.

This saves an allocation that is very much on the hot path in a
read-heavy load.
geesefs-0-30-9
Aaron Jacobs 2015-07-22 21:32:10 +10:00
parent 3755e07da2
commit 4b1e4b55f9
1 changed files with 3 additions and 5 deletions

View File

@ -653,6 +653,7 @@ func (o *OpenFileOp) toBazilfuseResponse() (bfResp interface{}) {
// more.
type ReadFileOp struct {
commonOp
bfResp bazilfuse.ReadResponse
// The file inode that we are reading, and the handle previously returned by
// CreateFile or OpenFile when opening that inode.
@ -676,11 +677,8 @@ type ReadFileOp struct {
}
func (o *ReadFileOp) toBazilfuseResponse() (bfResp interface{}) {
resp := bazilfuse.ReadResponse{
Data: o.Data,
}
bfResp = &resp
o.bfResp.Data = o.Data
bfResp = &o.bfResp
return
}