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

Run gofmt.

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