Commit ca5f9851 authored by Aaron Jacobs's avatar Aaron Jacobs

Fixed more errors.

parent d6a582c6
...@@ -43,10 +43,10 @@ import ( ...@@ -43,10 +43,10 @@ import (
// The FUSE version implemented by the package. // The FUSE version implemented by the package.
const ( const (
protoVersionMinMajor = 7 ProtoVersionMinMajor = 7
protoVersionMinMinor = 8 ProtoVersionMinMinor = 8
protoVersionMaxMajor = 7 ProtoVersionMaxMajor = 7
protoVersionMaxMinor = 12 ProtoVersionMaxMinor = 12
) )
const ( const (
...@@ -731,7 +731,7 @@ type InHeader struct { ...@@ -731,7 +731,7 @@ type InHeader struct {
const inHeaderSize = int(unsafe.Sizeof(InHeader{})) const inHeaderSize = int(unsafe.Sizeof(InHeader{}))
type outHeader struct { type OutHeader struct {
Len uint32 Len uint32
Error int32 Error int32
Unique uint64 Unique uint64
......
...@@ -194,7 +194,7 @@ func initMount(c *Conn, conf *mountConfig) error { ...@@ -194,7 +194,7 @@ func initMount(c *Conn, conf *mountConfig) error {
return fmt.Errorf("missing init, got: %T", req) return fmt.Errorf("missing init, got: %T", req)
} }
min := fusekernel.Protocol{protoVersionMinMajor, protoVersionMinMinor} min := fusekernel.Protocol{fusekernel.ProtoVersionMinMajor, fusekernel.ProtoVersionMinMinor}
if r.Kernel.LT(min) { if r.Kernel.LT(min) {
req.RespondError(Errno(syscall.EPROTO)) req.RespondError(Errno(syscall.EPROTO))
c.Close() c.Close()
...@@ -204,7 +204,7 @@ func initMount(c *Conn, conf *mountConfig) error { ...@@ -204,7 +204,7 @@ func initMount(c *Conn, conf *mountConfig) error {
} }
} }
proto := fusekernel.Protocol{protoVersionMaxMajor, protoVersionMaxMinor} proto := fusekernel.Protocol{fusekernel.ProtoVersionMaxMajor, fusekernel.ProtoVersionMaxMinor}
if r.Kernel.LT(proto) { if r.Kernel.LT(proto) {
// Kernel doesn't support the latest version we have. // Kernel doesn't support the latest version we have.
proto = r.Kernel proto = r.Kernel
...@@ -215,7 +215,7 @@ func initMount(c *Conn, conf *mountConfig) error { ...@@ -215,7 +215,7 @@ func initMount(c *Conn, conf *mountConfig) error {
Library: proto, Library: proto,
MaxReadahead: conf.maxReadahead, MaxReadahead: conf.maxReadahead,
MaxWrite: maxWrite, MaxWrite: maxWrite,
Flags: InitBigWrites | conf.initFlags, Flags: fusekernel.InitBigWrites | conf.initFlags,
} }
r.Respond(s) r.Respond(s)
return nil return nil
...@@ -275,7 +275,7 @@ func (h *Header) noResponse() { ...@@ -275,7 +275,7 @@ func (h *Header) noResponse() {
} }
func (h *Header) respond(msg []byte) { func (h *Header) respond(msg []byte) {
out := (*outHeader)(unsafe.Pointer(&msg[0])) out := (*fusekernel.OutHeader)(unsafe.Pointer(&msg[0]))
out.Unique = uint64(h.ID) out.Unique = uint64(h.ID)
h.Conn.respond(msg) h.Conn.respond(msg)
putMessage(h.msg) putMessage(h.msg)
...@@ -365,7 +365,7 @@ func (h *Header) RespondError(err error) { ...@@ -365,7 +365,7 @@ func (h *Header) RespondError(err error) {
// FUSE uses negative errors! // FUSE uses negative errors!
// TODO: File bug report against OSXFUSE: positive error causes kernel panic. // TODO: File bug report against OSXFUSE: positive error causes kernel panic.
buf := newBuffer(0) buf := newBuffer(0)
hOut := (*outHeader)(unsafe.Pointer(&buf[0])) hOut := (*fusekernel.OutHeader)(unsafe.Pointer(&buf[0]))
hOut.Error = -int32(errno) hOut.Error = -int32(errno)
h.respond(buf) h.respond(buf)
} }
...@@ -1046,7 +1046,7 @@ func errorString(err error) string { ...@@ -1046,7 +1046,7 @@ func errorString(err error) string {
} }
func (c *Conn) writeToKernel(msg []byte) error { func (c *Conn) writeToKernel(msg []byte) error {
out := (*outHeader)(unsafe.Pointer(&msg[0])) out := (*fusekernel.OutHeader)(unsafe.Pointer(&msg[0]))
out.Len = uint32(len(msg)) out.Len = uint32(len(msg))
c.wio.RLock() c.wio.RLock()
...@@ -1112,7 +1112,7 @@ func (c *Conn) sendInvalidate(msg []byte) error { ...@@ -1112,7 +1112,7 @@ func (c *Conn) sendInvalidate(msg []byte) error {
// node. // node.
func (c *Conn) InvalidateNode(nodeID NodeID, off int64, size int64) error { func (c *Conn) InvalidateNode(nodeID NodeID, off int64, size int64) error {
buf := newBuffer(unsafe.Sizeof(notifyInvalInodeOut{})) buf := newBuffer(unsafe.Sizeof(notifyInvalInodeOut{}))
h := (*outHeader)(unsafe.Pointer(&buf[0])) h := (*fusekernel.OutHeader)(unsafe.Pointer(&buf[0]))
// h.Unique is 0 // h.Unique is 0
h.Error = notifyCodeInvalInode h.Error = notifyCodeInvalInode
out := (*notifyInvalInodeOut)(buf.alloc(unsafe.Sizeof(notifyInvalInodeOut{}))) out := (*notifyInvalInodeOut)(buf.alloc(unsafe.Sizeof(notifyInvalInodeOut{})))
...@@ -1139,7 +1139,7 @@ func (c *Conn) InvalidateEntry(parent NodeID, name string) error { ...@@ -1139,7 +1139,7 @@ func (c *Conn) InvalidateEntry(parent NodeID, name string) error {
return syscall.ENAMETOOLONG return syscall.ENAMETOOLONG
} }
buf := newBuffer(unsafe.Sizeof(notifyInvalEntryOut{}) + uintptr(len(name)) + 1) buf := newBuffer(unsafe.Sizeof(notifyInvalEntryOut{}) + uintptr(len(name)) + 1)
h := (*outHeader)(unsafe.Pointer(&buf[0])) h := (*fusekernel.OutHeader)(unsafe.Pointer(&buf[0]))
// h.Unique is 0 // h.Unique is 0
h.Error = notifyCodeInvalEntry h.Error = notifyCodeInvalEntry
out := (*notifyInvalEntryOut)(buf.alloc(unsafe.Sizeof(notifyInvalEntryOut{}))) out := (*notifyInvalEntryOut)(buf.alloc(unsafe.Sizeof(notifyInvalEntryOut{})))
......
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