Commit 3173e6f3 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Rename fuseRequest to request.

parent 5c47ca23
...@@ -24,7 +24,7 @@ const ( ...@@ -24,7 +24,7 @@ const (
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
// State related to this mount point. // State related to this mount point.
type fuseRequest struct { type request struct {
inputBuf []byte inputBuf []byte
// These split up inputBuf. // These split up inputBuf.
...@@ -134,7 +134,7 @@ func (me *MountState) Error(err os.Error) { ...@@ -134,7 +134,7 @@ func (me *MountState) Error(err os.Error) {
} }
} }
func (me *MountState) Write(req *fuseRequest) { func (me *MountState) Write(req *request) {
if req.outHeaderBytes == nil { if req.outHeaderBytes == nil {
return return
} }
...@@ -193,14 +193,14 @@ func (me *MountState) Stats() string { ...@@ -193,14 +193,14 @@ func (me *MountState) Stats() string {
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
// Logic for the control loop. // Logic for the control loop.
func (me *MountState) newRequest() *fuseRequest { func (me *MountState) newRequest() *request {
req := new(fuseRequest) req := new(request)
req.status = OK req.status = OK
req.inputBuf = me.buffers.AllocBuffer(bufSize) req.inputBuf = me.buffers.AllocBuffer(bufSize)
return req return req
} }
func (me *MountState) readRequest(req *fuseRequest) os.Error { func (me *MountState) readRequest(req *request) os.Error {
n, err := me.mountFile.Read(req.inputBuf) n, err := me.mountFile.Read(req.inputBuf)
// If we start timing before the read, we may take into // If we start timing before the read, we may take into
// account waiting for input into the timing. // account waiting for input into the timing.
...@@ -209,7 +209,7 @@ func (me *MountState) readRequest(req *fuseRequest) os.Error { ...@@ -209,7 +209,7 @@ func (me *MountState) readRequest(req *fuseRequest) os.Error {
return err return err
} }
func (me *MountState) discardRequest(req *fuseRequest) { func (me *MountState) discardRequest(req *request) {
endNs := time.Nanoseconds() endNs := time.Nanoseconds()
dt := endNs - req.startNs dt := endNs - req.startNs
...@@ -272,7 +272,7 @@ func (me *MountState) loop() { ...@@ -272,7 +272,7 @@ func (me *MountState) loop() {
me.mountFile.Close() me.mountFile.Close()
} }
func (me *MountState) handle(req *fuseRequest) { func (me *MountState) handle(req *request) {
defer me.discardRequest(req) defer me.discardRequest(req)
req.dispatchNs = time.Nanoseconds() req.dispatchNs = time.Nanoseconds()
...@@ -292,7 +292,7 @@ func (me *MountState) handle(req *fuseRequest) { ...@@ -292,7 +292,7 @@ func (me *MountState) handle(req *fuseRequest) {
} }
} }
func (me *MountState) dispatch(req *fuseRequest) { func (me *MountState) dispatch(req *request) {
h := req.inHeader h := req.inHeader
argumentSize, ok := inputSizeMap[int(h.Opcode)] argumentSize, ok := inputSizeMap[int(h.Opcode)]
if !ok { if !ok {
...@@ -460,7 +460,7 @@ func asSlice(ptr unsafe.Pointer, byteCount int) []byte { ...@@ -460,7 +460,7 @@ func asSlice(ptr unsafe.Pointer, byteCount int) []byte {
return *(*[]byte)(unsafe.Pointer(h)) return *(*[]byte)(unsafe.Pointer(h))
} }
func serialize(req *fuseRequest, debug bool) { func serialize(req *request, debug bool) {
dataLength, ok := outputSizeMap[int(req.inHeader.Opcode)] dataLength, ok := outputSizeMap[int(req.inHeader.Opcode)]
if !ok { if !ok {
log.Println("Unknown opcode %d (output)", req.inHeader.Opcode) log.Println("Unknown opcode %d (output)", req.inHeader.Opcode)
......
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