Commit 9da364b3 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Run gofmt.

parent 5ae334dd
......@@ -8,6 +8,7 @@ import (
var _ = log.Println
type DefaultNodeFileSystem struct {
}
func (me *DefaultNodeFileSystem) OnUnmount() {
......
......@@ -337,4 +337,3 @@ func (me *FileSystemConnector) Flush(header *InHeader, input *FlushIn) Status {
opened := node.mount.getOpenedFile(input.Fh)
return opened.WithFlags.File.Flush()
}
......@@ -88,7 +88,6 @@ func (me *memNode) Unlink(name string, context *Context) (code Status) {
return OK
}
func (me *memNode) Rmdir(name string, context *Context) (code Status) {
return me.Unlink(name, context)
}
......@@ -160,7 +159,6 @@ func (me *memNode) Open(flags uint32, context *Context) (file File, code Status)
return me.newFile(f), OK
}
func (me *memNode) GetAttr(file File, context *Context) (fi *os.FileInfo, code Status) {
return &me.info, OK
}
......@@ -195,6 +193,3 @@ func (me *memNode) Chown(file File, uid uint32, gid uint32, context *Context) (c
me.info.Ctime_ns = time.Nanoseconds()
return OK
}
......@@ -44,7 +44,7 @@ func TestMemNodeFs(t *testing.T) {
wd, _, clean := setupMemNodeTest(t)
defer clean()
err := ioutil.WriteFile(wd + "/test", []byte{42}, 0644)
err := ioutil.WriteFile(wd+"/test", []byte{42}, 0644)
CheckSuccess(err)
fi, err := os.Lstat(wd + "/test")
......@@ -58,4 +58,3 @@ func TestMemNodeFs(t *testing.T) {
t.Fatalf("Readdir got %v, expected 1 file named 'test'", entries)
}
}
......@@ -91,7 +91,6 @@ func (me *PathNodeFs) Unmount(path string) Status {
return me.connector.Unmount(node)
}
func (me *PathNodeFs) OnUnmount() {
}
......
......@@ -123,10 +123,10 @@ func (me *memNode) Lookup(name string, context *fuse.Context) (fi *os.FileInfo,
return nil, nil, code
}
child := me.newNode(fi.Mode & fuse.S_IFDIR != 0)
child := me.newNode(fi.Mode&fuse.S_IFDIR != 0)
child.info = *fi
child.original = fn
if child.info.Mode & fuse.S_IFLNK != 0 {
if child.info.Mode&fuse.S_IFLNK != 0 {
child.link, _ = me.fs.readonly.Readlink(fn, context)
}
me.Inode().AddChild(name, child.Inode())
......@@ -270,7 +270,7 @@ func (me *memNode) promote() {
}
func (me *memNode) Open(flags uint32, context *fuse.Context) (file fuse.File, code fuse.Status) {
if flags & fuse.O_ANYWRITE != 0 {
if flags&fuse.O_ANYWRITE != 0 {
me.mutex.Lock()
defer me.mutex.Unlock()
......@@ -283,7 +283,7 @@ func (me *memNode) Open(flags uint32, context *fuse.Context) (file fuse.File, co
if err != nil {
return nil, fuse.OsErrorToErrno(err)
}
wr := flags & fuse.O_ANYWRITE != 0
wr := flags&fuse.O_ANYWRITE != 0
return me.newFile(&fuse.LoopbackFile{File: f}, wr), fuse.OK
}
......
......@@ -545,7 +545,7 @@ func TestMemUnionFsTruncGetAttr(t *testing.T) {
err = f.Close()
CheckSuccess(err)
fi, err := os.Lstat(wd+"/mount/file")
fi, err := os.Lstat(wd + "/mount/file")
if fi.Size != int64(len(c)) {
t.Fatalf("Length mismatch got %d want %d", fi.Size, len(c))
}
......
......@@ -622,7 +622,7 @@ func (me *UnionFs) promoteDirsTo(filename string) fuse.Status {
j := len(todo) - i - 1
d := todo[j]
r := results[j]
code := me.fileSystems[0].Mkdir(d, r.attr.Mode & 07777, nil)
code := me.fileSystems[0].Mkdir(d, r.attr.Mode&07777, nil)
if code != fuse.OK {
log.Println("Error creating dir leading to path", d, code)
return fuse.EPERM
......
......@@ -1061,13 +1061,12 @@ func TestTruncGetAttr(t *testing.T) {
err = f.Close()
CheckSuccess(err)
fi, err := os.Lstat(wd+"/mount/file")
fi, err := os.Lstat(wd + "/mount/file")
if fi.Size != int64(len(c)) {
t.Fatalf("Length mismatch got %d want %d", fi.Size, len(c))
}
}
func TestPromoteDirTimeStamp(t *testing.T) {
wd, clean := setupUfs(t)
defer clean()
......
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