Commit 8f980c13 authored by Ivan Krasin's avatar Ivan Krasin

fuse.Error -> fuse.Status

parent b72bba42
...@@ -14,9 +14,9 @@ const ( ...@@ -14,9 +14,9 @@ const (
) )
type FileSystem interface { type FileSystem interface {
List(parent string) (names []string, code Error) List(parent string) (names []string, code Status)
Lookup(parent, filename string) (out *Attr, code Error) Lookup(parent, filename string) (out *Attr, code Status)
GetAttr(path string, id *Identity, flags uint32) (out *AttrOut, code Error) GetAttr(path string, id *Identity, flags uint32) (out *AttrOut, code Status)
} }
type Mounted interface { type Mounted interface {
...@@ -105,7 +105,7 @@ func dispatch(fs FileSystem, in_data []byte, c *managerClient, toW chan [][]byte ...@@ -105,7 +105,7 @@ func dispatch(fs FileSystem, in_data []byte, c *managerClient, toW chan [][]byte
toW <- out toW <- out
} }
func serialize(h *InHeader, res Error, out interface{}) (data [][]byte, err os.Error) { func serialize(h *InHeader, res Status, out interface{}) (data [][]byte, err os.Error) {
b := new(bytes.Buffer) b := new(bytes.Buffer)
out_data := make([]byte, 0) out_data := make([]byte, 0)
fmt.Printf("OpCode: %v result: %v\n", h.Opcode, res) fmt.Printf("OpCode: %v result: %v\n", h.Opcode, res)
...@@ -122,7 +122,7 @@ func serialize(h *InHeader, res Error, out interface{}) (data [][]byte, err os.E ...@@ -122,7 +122,7 @@ func serialize(h *InHeader, res Error, out interface{}) (data [][]byte, err os.E
fmt.Printf("out_data: %v, len(out_data): %d, SizeOfOutHeader: %d\n", out_data, len(out_data), SizeOfOutHeader) fmt.Printf("out_data: %v, len(out_data): %d, SizeOfOutHeader: %d\n", out_data, len(out_data), SizeOfOutHeader)
var hout OutHeader var hout OutHeader
hout.Unique = h.Unique hout.Unique = h.Unique
hout.Error = int32(res) hout.Status = res
hout.Length = uint32(len(out_data) + SizeOfOutHeader) hout.Length = uint32(len(out_data) + SizeOfOutHeader)
b = new(bytes.Buffer) b = new(bytes.Buffer)
err = binary.Write(b, binary.LittleEndian, &hout) err = binary.Write(b, binary.LittleEndian, &hout)
...@@ -346,7 +346,7 @@ type managerResponse struct { ...@@ -346,7 +346,7 @@ type managerResponse struct {
fh uint64 fh uint64
dirReq chan *dirRequest dirReq chan *dirRequest
err os.Error err os.Error
code Error code Status
attr *Attr attr *Attr
path string path string
} }
......
...@@ -20,13 +20,13 @@ var ( ...@@ -20,13 +20,13 @@ var (
type testFuse struct{} type testFuse struct{}
func (fs *testFuse) GetAttr(path string, id *Identity, flags uint32) (out *AttrOut, code Error) { func (fs *testFuse) GetAttr(path string, id *Identity, flags uint32) (out *AttrOut, code Status) {
out = new(AttrOut) out = new(AttrOut)
out.Mode = S_IFDIR out.Mode = S_IFDIR
return return
} }
func (fs *testFuse) Lookup(parent, filename string) (out *Attr, code Error) { func (fs *testFuse) Lookup(parent, filename string) (out *Attr, code Status) {
fmt.Printf("testFuse.Lookup: %s\n", path.Join(parent, filename)) fmt.Printf("testFuse.Lookup: %s\n", path.Join(parent, filename))
out = new(Attr) out = new(Attr)
out.Mode = S_IFDIR out.Mode = S_IFDIR
...@@ -34,7 +34,7 @@ func (fs *testFuse) Lookup(parent, filename string) (out *Attr, code Error) { ...@@ -34,7 +34,7 @@ func (fs *testFuse) Lookup(parent, filename string) (out *Attr, code Error) {
return return
} }
func (fs *testFuse) List(dir string) (names []string, code Error) { func (fs *testFuse) List(dir string) (names []string, code Status) {
names = testFileNames names = testFileNames
return return
} }
......
...@@ -130,13 +130,13 @@ const ( ...@@ -130,13 +130,13 @@ const (
S_IFDIR = syscall.S_IFDIR S_IFDIR = syscall.S_IFDIR
) )
type Error int32 type Status int32
const ( const (
OK = Error(0) OK = Status(0)
EIO = Error(syscall.EIO) EIO = Status(syscall.EIO)
ENOSYS = Error(syscall.ENOSYS) ENOSYS = Status(syscall.ENOSYS)
ENODATA = Error(syscall.ENODATA) ENODATA = Status(syscall.ENODATA)
) )
type Opcode int type Opcode int
...@@ -507,7 +507,7 @@ const SizeOfOutHeader = 16 ...@@ -507,7 +507,7 @@ const SizeOfOutHeader = 16
type OutHeader struct { type OutHeader struct {
Length uint32 Length uint32
Error int32 Status Status
Unique uint64 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