Commit 83798dc7 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Run gofmt.

parent 50a64bf6
......@@ -7,6 +7,7 @@ import (
"os"
"testing"
)
var _ = log.Println
type cacheFs struct {
......
package fuse
import (
"os"
)
......
package fuse
import (
"os"
)
......
package fuse
import (
"os"
)
......@@ -44,7 +45,6 @@ func (me *DefaultFsNode) RmChild(name string, child FsNode) {
func (me *DefaultFsNode) AddChild(name string, child FsNode) {
}
func (me *DefaultFsNode) Lookup(name string) (fi *os.FileInfo, node FsNode, code Status) {
return nil, nil, ENOSYS
}
......@@ -113,7 +113,6 @@ func (me *DefaultFsNode) ListXAttr(context *Context) (attrs []string, code Statu
return nil, ENOSYS
}
func (me *DefaultFsNode) GetAttr(file File, context *Context) (fi *os.FileInfo, code Status) {
return nil, ENOSYS
}
......@@ -133,4 +132,3 @@ func (me *DefaultFsNode) Truncate(file File, size uint64, context *Context) (cod
func (me *DefaultFsNode) Utimens(file File, atime uint64, mtime uint64, context *Context) (code Status) {
return ENOSYS
}
......@@ -6,6 +6,7 @@ import (
"sync"
"unsafe"
)
var _ = log.Println
// openedFile stores either an open dir or an open file.
......
......@@ -11,7 +11,6 @@ import (
var _ = log.Println
func (me *FileSystemConnector) Init(fsInit *RawFsInit) {
me.fsInit = *fsInit
}
......@@ -238,7 +237,6 @@ func (me *FileSystemConnector) Symlink(header *InHeader, pointedTo string, linkN
return out, code
}
func (me *FileSystemConnector) Rename(header *InHeader, input *RenameIn, oldName string, newName string) (code Status) {
oldParent := me.getInodeData(header.NodeId)
isMountPoint := me.lookupMount(oldParent, oldName, 0) != nil
......
......@@ -49,7 +49,7 @@ type Inode struct {
// LockTree() Locks the mutex used for tree operations, and returns the
// unlock function.
func (me *Inode) LockTree() (func()) {
func (me *Inode) LockTree() func() {
// TODO - this API is tricky.
me.treeLock.Lock()
return func() { me.treeLock.Unlock() }
......@@ -61,7 +61,7 @@ func (me *Inode) AnyFile() (file File) {
defer me.openFilesMutex.Unlock()
for _, f := range me.openFiles {
if file == nil || f.OpenFlags & O_ANYWRITE != 0 {
if file == nil || f.OpenFlags&O_ANYWRITE != 0 {
file = f.file
}
}
......@@ -89,7 +89,7 @@ func (me *Inode) WritableFiles() (files []File) {
defer me.openFilesMutex.Unlock()
for _, f := range me.openFiles {
if f.OpenFlags & O_ANYWRITE != 0 {
if f.OpenFlags&O_ANYWRITE != 0 {
files = append(files, f.file)
}
}
......
......@@ -685,14 +685,14 @@ func TestDoubleOpen(t *testing.T) {
ts := NewTestCase(t)
defer ts.Cleanup()
err := ioutil.WriteFile(ts.orig +"/file", []byte("blabla"), 0644)
err := ioutil.WriteFile(ts.orig+"/file", []byte("blabla"), 0644)
CheckSuccess(err)
roFile, err := os.Open(ts.mnt + "/file")
CheckSuccess(err)
defer roFile.Close()
rwFile, err := os.OpenFile(ts.mnt + "/file", os.O_WRONLY | os.O_TRUNC, 0666)
rwFile, err := os.OpenFile(ts.mnt+"/file", os.O_WRONLY|os.O_TRUNC, 0666)
CheckSuccess(err)
defer rwFile.Close()
}
......@@ -40,7 +40,6 @@ func (me *PathNodeFs) Root() FsNode {
return me.root
}
// This is a combination of dentry (entry in the file/directory and
// the inode). This structure is used to implement glue for FSes where
// there is a one-to-one mapping of paths and inodes, ie. FSes that
......@@ -179,7 +178,6 @@ func (me *pathInode) Symlink(name string, content string, context *Context) (fi
return
}
func (me *pathInode) Rename(oldName string, newParent FsNode, newName string, context *Context) (code Status) {
p := newParent.(*pathInode)
oldPath := filepath.Join(me.GetPath(), oldName)
......@@ -278,7 +276,6 @@ func (me *pathInode) Chmod(file File, perms uint32, context *Context) (code Stat
return code
}
func (me *pathInode) Chown(file File, uid uint32, gid uint32, context *Context) (code Status) {
files := me.inode.WritableFiles()
for _, f := range files {
......
......@@ -893,7 +893,7 @@ func TestDoubleOpen(t *testing.T) {
roFile, err := os.Open(wd + "/mount/file")
CheckSuccess(err)
defer roFile.Close()
rwFile, err := os.OpenFile(wd + "/mount/file", os.O_WRONLY | os.O_TRUNC, 0666)
rwFile, err := os.OpenFile(wd+"/mount/file", os.O_WRONLY|os.O_TRUNC, 0666)
CheckSuccess(err)
defer rwFile.Close()
......@@ -921,4 +921,3 @@ func TestDoubleOpen(t *testing.T) {
}
}
}
......@@ -17,7 +17,6 @@ type memNode struct {
file MemFile
}
// MemTreeFs creates a tree of internal Inodes. Since the tree is
// loaded in memory completely at startup, it does not need to inode
// discovery through Lookup() at serve time.
......@@ -55,7 +54,7 @@ func (me *memNode) Print(indent int) {
fmt.Println(s + k + ":")
mn, ok := v.FsNode().(*memNode)
if ok {
mn.Print(indent+2)
mn.Print(indent + 2)
}
} else {
fmt.Println(s + k)
......
......@@ -44,7 +44,7 @@ func (me *TarFile) Data() []byte {
return me.data
}
func NewTarTree(r io.Reader) (map[string]MemFile) {
func NewTarTree(r io.Reader) map[string]MemFile {
files := map[string]MemFile{}
tr := tar.NewReader(r)
......
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