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

Move OutHeader.

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