Commit 71266c84 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Move OutHeader.

parent 6fd55492
...@@ -6,6 +6,8 @@ import ( ...@@ -6,6 +6,8 @@ import (
"log" "log"
"strings" "strings"
"unsafe" "unsafe"
"github.com/hanwen/go-fuse/raw"
) )
type request struct { type request struct {
...@@ -135,12 +137,12 @@ func (me *request) serialize() { ...@@ -135,12 +137,12 @@ func (me *request) serialize() {
dataLength = 0 dataLength = 0
} }
sizeOfOutHeader := unsafe.Sizeof(OutHeader{}) sizeOfOutHeader := unsafe.Sizeof(raw.OutHeader{})
me.outHeaderBytes = make([]byte, sizeOfOutHeader+dataLength) me.outHeaderBytes = make([]byte, sizeOfOutHeader+dataLength)
outHeader := (*OutHeader)(unsafe.Pointer(&me.outHeaderBytes[0])) outHeader := (*raw.OutHeader)(unsafe.Pointer(&me.outHeaderBytes[0]))
outHeader.Unique = me.inHeader.Unique outHeader.Unique = me.inHeader.Unique
outHeader.Status = -me.status outHeader.Status = int32(-me.status)
outHeader.Length = uint32( outHeader.Length = uint32(
int(sizeOfOutHeader) + int(dataLength) + int(len(me.flatData))) int(sizeOfOutHeader) + int(dataLength) + int(len(me.flatData)))
......
...@@ -176,7 +176,6 @@ type StatfsOut struct { ...@@ -176,7 +176,6 @@ type StatfsOut struct {
Kstatfs Kstatfs
} }
type InHeader struct { type InHeader struct {
Length uint32 Length uint32
opcode opcode
...@@ -186,12 +185,6 @@ type InHeader struct { ...@@ -186,12 +185,6 @@ type InHeader struct {
Padding uint32 Padding uint32
} }
type OutHeader struct {
Length uint32
Status Status
Unique uint64
}
type Dirent struct { type Dirent struct {
Ino uint64 Ino uint64
Off uint64 Off uint64
......
...@@ -270,3 +270,9 @@ type FsyncIn struct { ...@@ -270,3 +270,9 @@ type FsyncIn struct {
FsyncFlags uint32 FsyncFlags uint32
Padding uint32 Padding uint32
} }
type OutHeader struct {
Length uint32
Status int32
Unique uint64
}
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