Commit 69795504 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Add ENODATA.

parent 8e03191c
......@@ -84,7 +84,7 @@ type FSetAttrFs struct {
}
func (me *FSetAttrFs) GetXAttr(name string, attr string) ([]byte, Status) {
return nil, syscall.ENODATA
return nil, ENODATA
}
func (me *FSetAttrFs) GetAttr(name string) (*os.FileInfo, Status) {
......
......@@ -8,7 +8,6 @@ import (
"sort"
"strings"
"sync"
"syscall"
)
var _ = fmt.Println
......@@ -68,7 +67,7 @@ func (me *FileSystemDebug) getContent(path string) []byte {
func (me *FileSystemDebug) GetXAttr(name string, attr string) ([]byte, Status) {
if strings.HasPrefix(name, DebugDir) {
return nil, syscall.ENODATA
return nil, ENODATA
}
return me.FileSystem.GetXAttr(name, attr)
}
......
......@@ -48,6 +48,7 @@ const (
EIO = Status(syscall.EIO)
ENOENT = Status(syscall.ENOENT)
ENOSYS = Status(syscall.ENOSYS)
ENODATA = Status(syscall.ENODATA)
ENOTDIR = Status(syscall.ENOTDIR)
EPERM = Status(syscall.EPERM)
ERANGE = Status(syscall.ERANGE)
......
......@@ -55,7 +55,7 @@ func (me *XAttrTestFs) GetXAttr(name string, attr string) ([]byte, Status) {
}
v, ok := me.attrs[attr]
if !ok {
return nil, syscall.ENODATA
return nil, ENODATA
}
log.Println("GetXAttr", string(v))
return v, OK
......@@ -79,7 +79,7 @@ func (me *XAttrTestFs) RemoveXAttr(name string, attr string) Status {
_, ok := me.attrs[attr]
log.Println("RemoveXAttr", name, attr, ok)
if !ok {
return syscall.ENODATA
return ENODATA
}
me.attrs[attr] = nil, false
return OK
......@@ -149,7 +149,7 @@ func TestXAttrRead(t *testing.T) {
Removexattr(mounted, "third")
val, errno = GetXAttr(mounted, "third")
if errno != syscall.ENODATA {
if errno != ENODATA {
t.Error("Data not removed?", errno, val)
}
}
......@@ -232,7 +232,7 @@ func (me *AutoUnionFs) Unlink(path string) (code fuse.Status) {
// Must define this, because ENOSYS will suspend all GetXAttr calls.
func (me *AutoUnionFs) GetXAttr(name string, attr string) ([]byte, fuse.Status) {
return nil, syscall.ENODATA
return nil, fuse.ENODATA
}
func (me *AutoUnionFs) GetAttr(path string) (*os.FileInfo, fuse.Status) {
......
......@@ -611,7 +611,7 @@ func (me *UnionFs) GetAttr(name string) (a *os.FileInfo, s fuse.Status) {
func (me *UnionFs) GetXAttr(name string, attr string) ([]byte, fuse.Status) {
if name == _DROP_CACHE {
return nil, syscall.ENODATA
return nil, fuse.ENODATA
}
r := me.getBranch(name)
......
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