Commit 279e23da authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Run gofmt.

parent 2d84dd32
......@@ -69,15 +69,15 @@ func (me *DefaultRawFuseFileSystem) GetXAttr(header *InHeader, attr string) (dat
return nil, ENOSYS
}
func (me *DefaultRawFuseFileSystem) SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) (Status) {
func (me *DefaultRawFuseFileSystem) SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) Status {
return ENOSYS
}
func (me *DefaultRawFuseFileSystem) ListXAttr(header *InHeader) (data []byte, code Status) {
return nil, ENOSYS
return nil, ENOSYS
}
func (me *DefaultRawFuseFileSystem) RemoveXAttr(header *InHeader, attr string) (Status) {
func (me *DefaultRawFuseFileSystem) RemoveXAttr(header *InHeader, attr string) Status {
return ENOSYS
}
......@@ -112,7 +112,6 @@ func (me *DefaultRawFuseFileSystem) ReleaseDir(header *InHeader, f RawFuseDir) {
}
////////////////////////////////////////////////////////////////
// DefaultRawFuseFile
......@@ -162,7 +161,7 @@ func (me *DefaultPathFilesystem) GetXAttr(name string, attr string) ([]byte, Sta
return nil, ENOSYS
}
func (me *DefaultPathFilesystem) SetXAttr(name string, attr string, data []byte, flags int) (Status) {
func (me *DefaultPathFilesystem) SetXAttr(name string, attr string, data []byte, flags int) Status {
return ENOSYS
}
......@@ -170,7 +169,7 @@ func (me *DefaultPathFilesystem) ListXAttr(name string) ([]string, Status) {
return nil, ENOSYS
}
func (me *DefaultPathFilesystem) RemoveXAttr(name string, attr string) (Status) {
func (me *DefaultPathFilesystem) RemoveXAttr(name string, attr string) Status {
return ENOSYS
}
......
......@@ -158,7 +158,7 @@ func (me *LoopbackFileSystem) ListXAttr(name string) ([]string, Status) {
return data, Status(errNo)
}
func (me *LoopbackFileSystem) RemoveXAttr(name string, attr string) (Status) {
func (me *LoopbackFileSystem) RemoveXAttr(name string, attr string) Status {
return Status(Removexattr(me.GetPath(name), attr))
}
......
......@@ -726,16 +726,16 @@ func (me *PathFileSystemConnector) GetXAttr(header *InHeader, attribute string)
return data, code
}
func (me *PathFileSystemConnector) RemoveXAttr(header *InHeader, attr string) (Status) {
func (me *PathFileSystemConnector) RemoveXAttr(header *InHeader, attr string) Status {
path, mount := me.GetPath(header.NodeId)
if mount == nil {
return ENOENT
}
return mount.fs.RemoveXAttr(path, attr)
return mount.fs.RemoveXAttr(path, attr)
}
func (me *PathFileSystemConnector) SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) (Status) {
func (me *PathFileSystemConnector) SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) Status {
path, mount := me.GetPath(header.NodeId)
if mount == nil {
return ENOENT
......@@ -743,7 +743,7 @@ func (me *PathFileSystemConnector) SetXAttr(header *InHeader, input *SetXAttrIn,
return mount.fs.SetXAttr(path, attr, data, int(input.Flags))
}
func (me *PathFileSystemConnector) ListXAttr(header *InHeader) (data []byte, code Status) {
path, mount := me.GetPath(header.NodeId)
if mount == nil {
......@@ -760,7 +760,7 @@ func (me *PathFileSystemConnector) ListXAttr(header *InHeader) (data []byte, cod
b.Write([]byte(v))
b.WriteByte(0)
}
return b.Bytes(), code
}
......
......@@ -106,7 +106,7 @@ func (me *TimingPathFilesystem) ListXAttr(name string) ([]string, Status) {
return me.original.ListXAttr(name)
}
func (me *TimingPathFilesystem) RemoveXAttr(name string, attr string) (Status) {
func (me *TimingPathFilesystem) RemoveXAttr(name string, attr string) Status {
defer me.startTimer("RemoveXAttr", name)()
return me.original.RemoveXAttr(name, attr)
}
......@@ -200,4 +200,3 @@ func (me *TimingPathFilesystem) Utimens(name string, AtimeNs uint64, CtimeNs uin
defer me.startTimer("Utimens", name)()
return me.original.Utimens(name, AtimeNs, CtimeNs)
}
......@@ -136,7 +136,7 @@ func (me *TimingRawFilesystem) ListXAttr(header *InHeader) (data []byte, code St
return me.original.ListXAttr(header)
}
func (me *TimingRawFilesystem) RemoveXAttr(header *InHeader, attr string) (Status) {
func (me *TimingRawFilesystem) RemoveXAttr(header *InHeader, attr string) Status {
defer me.startTimer("RemoveXAttr")()
return me.original.RemoveXAttr(header, attr)
}
......@@ -180,4 +180,3 @@ func (me *TimingRawFilesystem) ReleaseDir(header *InHeader, f RawFuseDir) {
defer me.startTimer("ReleaseDir")()
me.original.ReleaseDir(header, f)
}
......@@ -518,7 +518,7 @@ type RawFileSystem interface {
GetXAttr(header *InHeader, attr string) (data []byte, code Status)
ListXAttr(header *InHeader) (attributes []byte, code Status)
SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) (Status)
SetXAttr(header *InHeader, input *SetXAttrIn, attr string, data []byte) Status
RemoveXAttr(header *InHeader, attr string) (code Status)
Access(header *InHeader, input *AccessIn) (code Status)
Create(header *InHeader, input *CreateIn, name string) (flags uint32, fuseFile RawFuseFile, out *EntryOut, code Status)
......@@ -567,10 +567,10 @@ type PathFilesystem interface {
GetXAttr(name string, attribute string) (data []byte, code Status)
SetXAttr(name string, attr string, data []byte, flags int) Status
ListXAttr(name string) (attributes []string, code Status)
RemoveXAttr(name string, attr string) (Status)
RemoveXAttr(name string, attr string) Status
// Where to hook up statfs?
OpenDir(name string) (stream chan DirEntry, code Status)
// TODO - what is a good interface?
......
......@@ -88,7 +88,7 @@ func (me *WrappingPathFilesystem) ListXAttr(name string) ([]string, Status) {
return me.original.ListXAttr(name)
}
func (me *WrappingPathFilesystem) RemoveXAttr(name string, attr string) (Status) {
func (me *WrappingPathFilesystem) RemoveXAttr(name string, attr string) Status {
return me.original.RemoveXAttr(name, attr)
}
......@@ -172,7 +172,7 @@ func (me *WrappingRawFilesystem) ListXAttr(header *InHeader) (data []byte, code
return me.original.ListXAttr(header)
}
func (me *WrappingRawFilesystem) RemoveXAttr(header *InHeader, attr string) (Status) {
func (me *WrappingRawFilesystem) RemoveXAttr(header *InHeader, attr string) Status {
return me.original.RemoveXAttr(header, attr)
}
......
......@@ -8,11 +8,12 @@ import (
"os"
"syscall"
)
var _ = log.Print
type XAttrTestFs struct {
filename string
attrs map[string][]byte
attrs map[string][]byte
DefaultPathFilesystem
}
......@@ -37,7 +38,7 @@ func (me *XAttrTestFs) GetAttr(name string) (*Attr, Status) {
return nil, ENOENT
}
func (me *XAttrTestFs) SetXAttr(name string, attr string, data []byte, flags int) (Status) {
func (me *XAttrTestFs) SetXAttr(name string, attr string, data []byte, flags int) Status {
if name != me.filename {
return ENOENT
}
......@@ -68,7 +69,7 @@ func (me *XAttrTestFs) ListXAttr(name string) (data []string, code Status) {
return data, OK
}
func (me *XAttrTestFs) RemoveXAttr(name string, attr string) (Status) {
func (me *XAttrTestFs) RemoveXAttr(name string, attr string) Status {
if name != me.filename {
return ENOENT
}
......@@ -128,7 +129,7 @@ func TestXAttrRead(t *testing.T) {
if len(readback) != len(golden) {
t.Error("length mismatch", golden, readback)
} else {
for k, v := range(readback) {
for k, v := range readback {
if bytes.Compare(golden[k], v) != 0 {
t.Error("val mismatch", k, v, golden[k])
}
......@@ -147,4 +148,3 @@ func TestXAttrRead(t *testing.T) {
t.Error("Data not removed?", errno, val)
}
}
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