Skip to content

Commit

Permalink
Make returnRequest actually return the read buffer to readPool
Browse files Browse the repository at this point in the history
Due to a typo, returnRequest never actually returned the read buffer
to readPool.

Also, we want to put the complete buffer back into the pool - this
caused errors later on.

loopback "tar xzf ../linux-3.0.tar.gz" timings:

before: 35 seconds
after:  10 seconds
  • Loading branch information
rfjakob committed Jan 10, 2016
1 parent 8a12a94 commit c4b6b79
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fuse/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func (r *request) setInput(input []byte) bool {
return false
}
r.inputBuf = input
r.bufferPoolInputBuf = input
r.bufferPoolInputBuf = input[:cap(input)]

return true
}
Expand Down
2 changes: 1 addition & 1 deletion fuse/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func (ms *Server) returnRequest(req *request) {

req.clear()
ms.reqMu.Lock()
if req.bufferPoolOutputBuf != nil {
if req.bufferPoolInputBuf != nil {
ms.readPool.Put(req.bufferPoolInputBuf)
req.bufferPoolInputBuf = nil
ms.outstandingReadBufs--
Expand Down

0 comments on commit c4b6b79

Please sign in to comment.