Commit 6d5f84b0 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Run gofmt.

parent 7aa7dde6
...@@ -18,11 +18,11 @@ func (me *HelloFs) GetAttr(name string, context *fuse.Context) (*os.FileInfo, fu ...@@ -18,11 +18,11 @@ func (me *HelloFs) GetAttr(name string, context *fuse.Context) (*os.FileInfo, fu
case "file.txt": case "file.txt":
return &os.FileInfo{ return &os.FileInfo{
Mode: fuse.S_IFREG | 0644, Size: int64(len(name)), Mode: fuse.S_IFREG | 0644, Size: int64(len(name)),
},fuse.OK }, fuse.OK
case "": case "":
return &os.FileInfo{ return &os.FileInfo{
Mode: fuse.S_IFDIR | 0755, Mode: fuse.S_IFDIR | 0755,
},fuse.OK }, fuse.OK
} }
return nil, fuse.ENOENT return nil, fuse.ENOENT
} }
......
...@@ -90,7 +90,7 @@ type nonseekFs struct { ...@@ -90,7 +90,7 @@ type nonseekFs struct {
func (me *nonseekFs) GetAttr(name string, context *Context) (fi *os.FileInfo, status Status) { func (me *nonseekFs) GetAttr(name string, context *Context) (fi *os.FileInfo, status Status) {
if name == "file" { if name == "file" {
return &os.FileInfo{ Mode: S_IFREG | 0644 }, OK return &os.FileInfo{Mode: S_IFREG | 0644}, OK
} }
return nil, ENOENT return nil, ENOENT
} }
...@@ -110,7 +110,7 @@ func (me *nonseekFs) Open(name string, flags uint32, context *Context) (fuseFile ...@@ -110,7 +110,7 @@ func (me *nonseekFs) Open(name string, flags uint32, context *Context) (fuseFile
func TestNonseekable(t *testing.T) { func TestNonseekable(t *testing.T) {
fs := &nonseekFs{} fs := &nonseekFs{}
fs.Length = 200*1024 fs.Length = 200 * 1024
dir := MakeTempDir() dir := MakeTempDir()
defer os.RemoveAll(dir) defer os.RemoveAll(dir)
......
...@@ -163,7 +163,7 @@ func DecodeHandle(handle uint64) (val *Handled) { ...@@ -163,7 +163,7 @@ func DecodeHandle(handle uint64) (val *Handled) {
if unsafe.Sizeof(val) == 8 { if unsafe.Sizeof(val) == 8 {
ptrBits := uintptr(handle & (1<<45 - 1)) ptrBits := uintptr(handle & (1<<45 - 1))
check = uint32(handle >> 45) check = uint32(handle >> 45)
val = (*Handled)(unsafe.Pointer(ptrBits << 3 + uintptr(baseAddress))) val = (*Handled)(unsafe.Pointer(ptrBits<<3 + uintptr(baseAddress)))
} }
if unsafe.Sizeof(val) == 4 { if unsafe.Sizeof(val) == 4 {
val = (*Handled)(unsafe.Pointer(uintptr(handle & ((1 << 32) - 1)))) val = (*Handled)(unsafe.Pointer(uintptr(handle & ((1 << 32) - 1))))
......
...@@ -698,7 +698,6 @@ func (me *FileSystemConnector) EntryNotify(dir string, name string) Status { ...@@ -698,7 +698,6 @@ func (me *FileSystemConnector) EntryNotify(dir string, name string) Status {
return me.fsInit.EntryNotify(node.NodeId, name) return me.fsInit.EntryNotify(node.NodeId, name)
} }
func (me *FileSystemConnector) Notify(path string) Status { func (me *FileSystemConnector) Notify(path string) Status {
node, rest := me.findLastKnownInode(path) node, rest := me.findLastKnownInode(path)
if len(rest) > 0 { if len(rest) > 0 {
...@@ -709,4 +708,3 @@ func (me *FileSystemConnector) Notify(path string) Status { ...@@ -709,4 +708,3 @@ func (me *FileSystemConnector) Notify(path string) Status {
} }
return me.fsInit.InodeNotify(&out) return me.fsInit.InodeNotify(&out)
} }
...@@ -58,7 +58,7 @@ func (me *ReadonlyFileSystem) Truncate(name string, offset uint64, context *Cont ...@@ -58,7 +58,7 @@ func (me *ReadonlyFileSystem) Truncate(name string, offset uint64, context *Cont
} }
func (me *ReadonlyFileSystem) Open(name string, flags uint32, context *Context) (file File, code Status) { func (me *ReadonlyFileSystem) Open(name string, flags uint32, context *Context) (file File, code Status) {
if flags & O_ANYWRITE != 0 { if flags&O_ANYWRITE != 0 {
return nil, EPERM return nil, EPERM
} }
// TODO - wrap the File object inside a R/O wrapper too? // TODO - wrap the File object inside a R/O wrapper too?
......
...@@ -159,7 +159,7 @@ func TestSymlinkPromote(t *testing.T) { ...@@ -159,7 +159,7 @@ func TestSymlinkPromote(t *testing.T) {
wd, clean := setupUfs(t) wd, clean := setupUfs(t)
defer clean() defer clean()
err := os.Mkdir(wd + "/ro/subdir", 0755) err := os.Mkdir(wd+"/ro/subdir", 0755)
CheckSuccess(err) CheckSuccess(err)
err = os.Symlink("/foobar", wd+"/mount/subdir/link") err = os.Symlink("/foobar", wd+"/mount/subdir/link")
...@@ -688,7 +688,7 @@ func TestRmRf(t *testing.T) { ...@@ -688,7 +688,7 @@ func TestRmRf(t *testing.T) {
CheckSuccess(err) CheckSuccess(err)
bin, err := exec.LookPath("rm") bin, err := exec.LookPath("rm")
CheckSuccess(err) CheckSuccess(err)
cmd := exec.Command(bin, "-rf", wd + "/mount/dir") cmd := exec.Command(bin, "-rf", wd+"/mount/dir")
err = cmd.Run() err = cmd.Run()
if err != nil { if err != nil {
t.Fatal("rm -rf returned error:", err) t.Fatal("rm -rf returned error:", err)
...@@ -868,7 +868,7 @@ func TestDeletedGetAttr(t *testing.T) { ...@@ -868,7 +868,7 @@ func TestDeletedGetAttr(t *testing.T) {
CheckSuccess(err) CheckSuccess(err)
defer f.Close() defer f.Close()
err = os.Remove(wd+"/mount/file") err = os.Remove(wd + "/mount/file")
CheckSuccess(err) CheckSuccess(err)
if fi, err := f.Stat(); err != nil || !fi.IsRegular() { if fi, err := f.Stat(); err != nil || !fi.IsRegular() {
......
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