Commit 94bf1c34 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse: Hide MountState.AllocOut

parent 29475a2f
...@@ -365,7 +365,7 @@ func (ms *MountState) handleRequest(req *request) { ...@@ -365,7 +365,7 @@ func (ms *MountState) handleRequest(req *request) {
ms.returnRequest(req) ms.returnRequest(req)
} }
func (ms *MountState) AllocOut(req *request, size uint32) []byte { func (ms *MountState) allocOut(req *request, size uint32) []byte {
if cap(req.bufferPoolOutputBuf) >= int(size) { if cap(req.bufferPoolOutputBuf) >= int(size) {
req.bufferPoolOutputBuf = req.bufferPoolOutputBuf[:size] req.bufferPoolOutputBuf = req.bufferPoolOutputBuf[:size]
return req.bufferPoolOutputBuf return req.bufferPoolOutputBuf
......
...@@ -12,7 +12,7 @@ func (ms *MountState) systemWrite(req *request, header []byte) Status { ...@@ -12,7 +12,7 @@ func (ms *MountState) systemWrite(req *request, header []byte) Status {
if req.fdData != nil { if req.fdData != nil {
sz := req.flatDataSize() sz := req.flatDataSize()
buf := ms.AllocOut(req, uint32(sz)) buf := ms.allocOut(req, uint32(sz))
req.flatData, req.status = req.fdData.Bytes(buf) req.flatData, req.status = req.fdData.Bytes(buf)
header = req.serializeHeader(len(req.flatData)) header = req.serializeHeader(len(req.flatData))
} }
......
...@@ -22,7 +22,7 @@ func (ms *MountState) systemWrite(req *request, header []byte) Status { ...@@ -22,7 +22,7 @@ func (ms *MountState) systemWrite(req *request, header []byte) Status {
} }
sz := req.flatDataSize() sz := req.flatDataSize()
buf := ms.AllocOut(req, uint32(sz)) buf := ms.allocOut(req, uint32(sz))
req.flatData, req.status = req.fdData.Bytes(buf) req.flatData, req.status = req.fdData.Bytes(buf)
header = req.serializeHeader(len(req.flatData)) header = req.serializeHeader(len(req.flatData))
} }
......
...@@ -122,7 +122,7 @@ func doCreate(state *MountState, req *request) { ...@@ -122,7 +122,7 @@ func doCreate(state *MountState, req *request) {
func doReadDir(state *MountState, req *request) { func doReadDir(state *MountState, req *request) {
in := (*raw.ReadIn)(req.inData) in := (*raw.ReadIn)(req.inData)
buf := state.AllocOut(req, in.Size) buf := state.allocOut(req, in.Size)
entries := NewDirEntryList(buf, uint64(in.Offset)) entries := NewDirEntryList(buf, uint64(in.Offset))
code := state.fileSystem.ReadDir(entries, &req.context, in) code := state.fileSystem.ReadDir(entries, &req.context, in)
...@@ -273,7 +273,7 @@ func doLink(state *MountState, req *request) { ...@@ -273,7 +273,7 @@ func doLink(state *MountState, req *request) {
func doRead(state *MountState, req *request) { func doRead(state *MountState, req *request) {
in := (*raw.ReadIn)(req.inData) in := (*raw.ReadIn)(req.inData)
buf := state.AllocOut(req, in.Size) buf := state.allocOut(req, in.Size)
req.readResult, req.status = state.fileSystem.Read(&req.context, in, buf) req.readResult, req.status = state.fileSystem.Read(&req.context, in, buf)
if fd, ok := req.readResult.(*ReadResultFd); ok { if fd, ok := req.readResult.(*ReadResultFd); ok {
......
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