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
case "file.txt":
return &os.FileInfo{
Mode: fuse.S_IFREG | 0644, Size: int64(len(name)),
},fuse.OK
}, fuse.OK
case "":
return &os.FileInfo{
Mode: fuse.S_IFDIR | 0755,
},fuse.OK
}, fuse.OK
}
return nil, fuse.ENOENT
}
......
......@@ -111,14 +111,14 @@ type FileSystemOptions struct {
// make inode numbers (exported back to callers) stay within
// int64 (assuming the process uses less than 4G memory.).
// 64-bit inode numbers makes stat() in 32-bit programs fail.
SkipCheckHandles bool
SkipCheckHandles bool
}
type MountOptions struct {
AllowOther bool
// Options are passed as -o string to fusermount.
Options []string
Options []string
// Default is _DEFAULT_BACKGROUND_TASKS, 12.
MaxBackground int
......
......@@ -90,7 +90,7 @@ type nonseekFs struct {
func (me *nonseekFs) GetAttr(name string, context *Context) (fi *os.FileInfo, status Status) {
if name == "file" {
return &os.FileInfo{ Mode: S_IFREG | 0644 }, OK
return &os.FileInfo{Mode: S_IFREG | 0644}, OK
}
return nil, ENOENT
}
......@@ -110,7 +110,7 @@ func (me *nonseekFs) Open(name string, flags uint32, context *Context) (fuseFile
func TestNonseekable(t *testing.T) {
fs := &nonseekFs{}
fs.Length = 200*1024
fs.Length = 200 * 1024
dir := MakeTempDir()
defer os.RemoveAll(dir)
......
......@@ -152,7 +152,7 @@ func TestFSetAttr(t *testing.T) {
if state.KernelSettings().Flags&CAP_FILE_OPS == 0 {
log.Println("Mount does not support file operations")
}
_, err = f.Stat()
CheckSuccess(err)
......
......@@ -163,7 +163,7 @@ func DecodeHandle(handle uint64) (val *Handled) {
if unsafe.Sizeof(val) == 8 {
ptrBits := uintptr(handle & (1<<45 - 1))
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 {
val = (*Handled)(unsafe.Pointer(uintptr(handle & ((1 << 32) - 1))))
......
......@@ -698,15 +698,13 @@ func (me *FileSystemConnector) EntryNotify(dir string, name string) Status {
return me.fsInit.EntryNotify(node.NodeId, name)
}
func (me *FileSystemConnector) Notify(path string) Status {
node, rest := me.findLastKnownInode(path)
if len(rest) > 0 {
return me.fsInit.EntryNotify(node.NodeId, rest[0])
return me.fsInit.EntryNotify(node.NodeId, rest[0])
}
out := NotifyInvalInodeOut{
Ino: node.NodeId,
Ino: node.NodeId,
}
return me.fsInit.InodeNotify(&out)
}
......@@ -170,8 +170,8 @@ func (me *FileSystemConnector) OpenDir(header *InHeader, input *OpenIn) (flags u
extra: node.GetMountDirEntries(),
stream: stream,
}
de.extra = append(de.extra, DirEntry{S_IFDIR, "."}, DirEntry{S_IFDIR, ".."})
de.extra = append(de.extra, DirEntry{S_IFDIR, "."}, DirEntry{S_IFDIR, ".."})
h, opened := mount.registerFileHandle(node, de, nil, input.Flags)
return opened.FuseFlags, h, OK
......
......@@ -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) {
if flags & O_ANYWRITE != 0 {
if flags&O_ANYWRITE != 0 {
return nil, EPERM
}
// TODO - wrap the File object inside a R/O wrapper too?
......
......@@ -159,7 +159,7 @@ func TestSymlinkPromote(t *testing.T) {
wd, clean := setupUfs(t)
defer clean()
err := os.Mkdir(wd + "/ro/subdir", 0755)
err := os.Mkdir(wd+"/ro/subdir", 0755)
CheckSuccess(err)
err = os.Symlink("/foobar", wd+"/mount/subdir/link")
......@@ -688,7 +688,7 @@ func TestRmRf(t *testing.T) {
CheckSuccess(err)
bin, err := exec.LookPath("rm")
CheckSuccess(err)
cmd := exec.Command(bin, "-rf", wd + "/mount/dir")
cmd := exec.Command(bin, "-rf", wd+"/mount/dir")
err = cmd.Run()
if err != nil {
t.Fatal("rm -rf returned error:", err)
......@@ -868,7 +868,7 @@ func TestDeletedGetAttr(t *testing.T) {
CheckSuccess(err)
defer f.Close()
err = os.Remove(wd+"/mount/file")
err = os.Remove(wd + "/mount/file")
CheckSuccess(err)
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