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
} }
......
...@@ -111,14 +111,14 @@ type FileSystemOptions struct { ...@@ -111,14 +111,14 @@ type FileSystemOptions struct {
// make inode numbers (exported back to callers) stay within // make inode numbers (exported back to callers) stay within
// int64 (assuming the process uses less than 4G memory.). // int64 (assuming the process uses less than 4G memory.).
// 64-bit inode numbers makes stat() in 32-bit programs fail. // 64-bit inode numbers makes stat() in 32-bit programs fail.
SkipCheckHandles bool SkipCheckHandles bool
} }
type MountOptions struct { type MountOptions struct {
AllowOther bool AllowOther bool
// Options are passed as -o string to fusermount. // Options are passed as -o string to fusermount.
Options []string Options []string
// Default is _DEFAULT_BACKGROUND_TASKS, 12. // Default is _DEFAULT_BACKGROUND_TASKS, 12.
MaxBackground int MaxBackground int
......
...@@ -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)
......
...@@ -152,7 +152,7 @@ func TestFSetAttr(t *testing.T) { ...@@ -152,7 +152,7 @@ func TestFSetAttr(t *testing.T) {
if state.KernelSettings().Flags&CAP_FILE_OPS == 0 { if state.KernelSettings().Flags&CAP_FILE_OPS == 0 {
log.Println("Mount does not support file operations") log.Println("Mount does not support file operations")
} }
_, err = f.Stat() _, err = f.Stat()
CheckSuccess(err) CheckSuccess(err)
......
...@@ -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,15 +698,13 @@ func (me *FileSystemConnector) EntryNotify(dir string, name string) Status { ...@@ -698,15 +698,13 @@ 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 {
return me.fsInit.EntryNotify(node.NodeId, rest[0]) return me.fsInit.EntryNotify(node.NodeId, rest[0])
} }
out := NotifyInvalInodeOut{ out := NotifyInvalInodeOut{
Ino: node.NodeId, Ino: node.NodeId,
} }
return me.fsInit.InodeNotify(&out) return me.fsInit.InodeNotify(&out)
} }
...@@ -170,8 +170,8 @@ func (me *FileSystemConnector) OpenDir(header *InHeader, input *OpenIn) (flags u ...@@ -170,8 +170,8 @@ func (me *FileSystemConnector) OpenDir(header *InHeader, input *OpenIn) (flags u
extra: node.GetMountDirEntries(), extra: node.GetMountDirEntries(),
stream: stream, 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) h, opened := mount.registerFileHandle(node, de, nil, input.Flags)
return opened.FuseFlags, h, OK return opened.FuseFlags, h, OK
......
...@@ -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