Skip to content

Commit c4b6b79

Browse files
committed
Make returnRequest actually return the read buffer to readPool
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
1 parent 8a12a94 commit c4b6b79

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fuse/request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (r *request) setInput(input []byte) bool {
126126
return false
127127
}
128128
r.inputBuf = input
129-
r.bufferPoolInputBuf = input
129+
r.bufferPoolInputBuf = input[:cap(input)]
130130

131131
return true
132132
}

fuse/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ func (ms *Server) returnRequest(req *request) {
283283

284284
req.clear()
285285
ms.reqMu.Lock()
286-
if req.bufferPoolOutputBuf != nil {
286+
if req.bufferPoolInputBuf != nil {
287287
ms.readPool.Put(req.bufferPoolInputBuf)
288288
req.bufferPoolInputBuf = nil
289289
ms.outstandingReadBufs--

0 commit comments

Comments
 (0)