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

Run gofmt.

parent e3ad7b09
......@@ -142,8 +142,8 @@ type File interface {
// Wrappers around other File implementations, should return
// the inner file here.
InnerFile() File
InnerFile() File
Read(*ReadIn, BufferPool) ([]byte, Status)
Write(*WriteIn, []byte) (written uint32, code Status)
Truncate(size uint64) Status
......
......@@ -155,7 +155,7 @@ func TestFSetAttr(t *testing.T) {
defer f.Close()
fi, err := f.Stat()
CheckSuccess(err)
_, err = f.WriteString("hello")
CheckSuccess(err)
......
......@@ -42,7 +42,7 @@ func (me *FileSystemConnector) Lookup(header *InHeader, name string) (out *Entry
}
mount := parent.mount
child := parent.GetChild(name)
if child != nil {
parent = nil
......
......@@ -494,20 +494,20 @@ func init() {
// Inputs.
for op, f := range map[opcode]castPointerFunc{
_OP_GETATTR: func(ptr unsafe.Pointer) interface{} { return (*GetAttrIn)(ptr) },
_OP_SETATTR: func(ptr unsafe.Pointer) interface{} { return (*SetAttrIn)(ptr) },
_OP_INIT: func(ptr unsafe.Pointer) interface{} { return (*InitIn)(ptr) },
_OP_IOCTL: func(ptr unsafe.Pointer) interface{} { return (*IoctlIn)(ptr) },
_OP_OPEN: func(ptr unsafe.Pointer) interface{} { return (*OpenIn)(ptr) },
_OP_MKNOD: func(ptr unsafe.Pointer) interface{} { return (*MknodIn)(ptr) },
_OP_CREATE: func(ptr unsafe.Pointer) interface{} { return (*CreateIn)(ptr) },
_OP_READ: func(ptr unsafe.Pointer) interface{} { return (*ReadIn)(ptr) },
_OP_READDIR: func(ptr unsafe.Pointer) interface{} { return (*ReadIn)(ptr) },
_OP_ACCESS: func(ptr unsafe.Pointer) interface{} { return (*AccessIn)(ptr) },
_OP_FORGET: func(ptr unsafe.Pointer) interface{} { return (*ForgetIn)(ptr) },
_OP_LINK: func(ptr unsafe.Pointer) interface{} { return (*LinkIn)(ptr) },
_OP_MKDIR: func(ptr unsafe.Pointer) interface{} { return (*MkdirIn)(ptr) },
_OP_RELEASE: func(ptr unsafe.Pointer) interface{} { return (*ReleaseIn)(ptr) },
_OP_GETATTR: func(ptr unsafe.Pointer) interface{} { return (*GetAttrIn)(ptr) },
_OP_SETATTR: func(ptr unsafe.Pointer) interface{} { return (*SetAttrIn)(ptr) },
_OP_INIT: func(ptr unsafe.Pointer) interface{} { return (*InitIn)(ptr) },
_OP_IOCTL: func(ptr unsafe.Pointer) interface{} { return (*IoctlIn)(ptr) },
_OP_OPEN: func(ptr unsafe.Pointer) interface{} { return (*OpenIn)(ptr) },
_OP_MKNOD: func(ptr unsafe.Pointer) interface{} { return (*MknodIn)(ptr) },
_OP_CREATE: func(ptr unsafe.Pointer) interface{} { return (*CreateIn)(ptr) },
_OP_READ: func(ptr unsafe.Pointer) interface{} { return (*ReadIn)(ptr) },
_OP_READDIR: func(ptr unsafe.Pointer) interface{} { return (*ReadIn)(ptr) },
_OP_ACCESS: func(ptr unsafe.Pointer) interface{} { return (*AccessIn)(ptr) },
_OP_FORGET: func(ptr unsafe.Pointer) interface{} { return (*ForgetIn)(ptr) },
_OP_LINK: func(ptr unsafe.Pointer) interface{} { return (*LinkIn)(ptr) },
_OP_MKDIR: func(ptr unsafe.Pointer) interface{} { return (*MkdirIn)(ptr) },
_OP_RELEASE: func(ptr unsafe.Pointer) interface{} { return (*ReleaseIn)(ptr) },
_OP_RELEASEDIR: func(ptr unsafe.Pointer) interface{} { return (*ReleaseIn)(ptr) },
} {
operationHandlers[op].DecodeIn = f
......
......@@ -32,7 +32,7 @@ type PathNodeFs struct {
connector *FileSystemConnector
// protects clientInodeMap and pathInode.Parent pointers
pathLock sync.RWMutex
pathLock sync.RWMutex
// This map lists all the parent links known for a given
// nodeId.
......@@ -174,12 +174,12 @@ type pathInode struct {
DefaultFsNode
}
func (me *pathInode) LockTree() (func()) {
func (me *pathInode) LockTree() func() {
me.pathFs.pathLock.Lock()
return func() { me.pathFs.pathLock.Unlock() }
}
func (me *pathInode) RLockTree() (func()) {
func (me *pathInode) RLockTree() func() {
me.pathFs.pathLock.RLock()
return func() { me.pathFs.pathLock.RUnlock() }
}
......@@ -282,7 +282,7 @@ func (me *pathInode) setClientInode(ino uint64) {
if me.clientInode != 0 {
me.pathFs.clientInodeMap[me.clientInode] = nil, false
}
me.clientInode = ino
if me.Parent != nil {
e := &clientInodePath{
......@@ -421,7 +421,7 @@ func (me *pathInode) Link(name string, existingFsnode FsNode, context *Context)
me.addChild(name, existing)
} else {
pNode := me.createChild(false)
newNode = pNode
newNode = pNode
pNode.clientInode = fi.Ino
me.addChild(name, pNode)
}
......
......@@ -224,7 +224,6 @@ type CreateOut struct {
OpenOut
}
const RELEASE_FLUSH = (1 << 0)
type ReleaseIn struct {
......
......@@ -186,7 +186,7 @@ func (me *AutoUnionFs) updateKnownFses() {
filepath.Walk(path,
func(path string, fi *os.FileInfo, err os.Error) os.Error {
return me.visit(path, fi, err)
})
})
}
}
}
......
......@@ -163,8 +163,8 @@ type branchResult struct {
func printFileInfo(me *os.FileInfo) string {
return fmt.Sprintf(
"{0%o S=%d L=%d %d:%d %d*%d %d:%d " +
"A %.09f M %.09f C %.09f}",
"{0%o S=%d L=%d %d:%d %d*%d %d:%d "+
"A %.09f M %.09f C %.09f}",
me.Mode, me.Size, me.Nlink, me.Uid, me.Gid, me.Blocks, me.Blksize, me.Rdev, me.Ino,
float64(me.Atime_ns)*1e-9, float64(me.Mtime_ns)*1e-9, float64(me.Ctime_ns)*1e-9)
}
......@@ -173,7 +173,6 @@ func (me branchResult) String() string {
return fmt.Sprintf("{%s %v branch %d}", printFileInfo(me.attr), me.code, me.branch)
}
func (me *UnionFs) getBranchAttrNoCache(name string) branchResult {
name = stripSlash(name)
......@@ -299,7 +298,7 @@ func (me *UnionFs) Promote(name string, srcResult branchResult, context *fuse.Co
if uf == nil {
panic("no unionFsFile found inside")
}
if uf.layer > 0 {
uf.layer = 0
uf.File.Release()
......@@ -961,15 +960,15 @@ func (me *UnionFs) StatFs() *fuse.StatfsOut {
type unionFsFile struct {
fuse.File
ufs *UnionFs
node *fuse.Inode
ufs *UnionFs
node *fuse.Inode
layer int
}
func (me *UnionFs) newUnionFsFile(f fuse.File, branch int) *unionFsFile {
return &unionFsFile{
File: f,
ufs: me,
File: f,
ufs: me,
layer: branch,
}
}
......
......@@ -1027,8 +1027,8 @@ func TestFlushRename(t *testing.T) {
wd, clean := setupUfs(t)
defer clean()
err := ioutil.WriteFile(wd +"/mount/file", []byte("x"), 0644)
err := ioutil.WriteFile(wd+"/mount/file", []byte("x"), 0644)
fn := wd + "/mount/tmp"
f, err := os.OpenFile(fn, os.O_WRONLY|os.O_CREATE, 0644)
CheckSuccess(err)
......@@ -1042,7 +1042,7 @@ func TestFlushRename(t *testing.T) {
dst := wd + "/mount/file"
err = os.Rename(fn, dst)
CheckSuccess(err)
fi, err = os.Lstat(dst)
CheckSuccess(err)
if fi.Size != int64(n) {
......
......@@ -83,7 +83,7 @@ func TestMultiZipFs(t *testing.T) {
if !fi.IsDirectory() {
t.Fatal("expect directory for /zipmount, got %v", fi)
}
// Check that zipfs itself works.
fi, err = os.Stat(mountPoint + "/zipmount/subdir")
CheckSuccess(err)
......
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