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

Run gofmt.

parent 7e4c459b
...@@ -17,7 +17,7 @@ func main() { ...@@ -17,7 +17,7 @@ func main() {
filename := flag.Args()[0] filename := flag.Args()[0]
f, err := os.Open(filename, os.O_RDONLY, 0) f, err := os.Open(filename, os.O_RDONLY, 0)
if err != nil { if err != nil {
panic("err"+err.String()) panic("err" + err.String())
} }
linelen := 1000 linelen := 1000
...@@ -37,7 +37,7 @@ func main() { ...@@ -37,7 +37,7 @@ func main() {
dts := make(chan int64, parallel) dts := make(chan int64, parallel)
fmt.Printf("Statting %d files with %d threads\n", len(files), parallel) fmt.Printf("Statting %d files with %d threads\n", len(files), parallel)
for i := 0 ; i < parallel; i++ { for i := 0; i < parallel; i++ {
go func() { go func() {
for { for {
fn := <-todo fn := <-todo
...@@ -57,7 +57,7 @@ func main() { ...@@ -57,7 +57,7 @@ func main() {
} }
total := 0.0 total := 0.0
for i := 0 ; i < len(files); i++ { for i := 0; i < len(files); i++ {
total += float64(<-dts) * 1e-6 total += float64(<-dts) * 1e-6
} }
......
...@@ -71,7 +71,7 @@ func main() { ...@@ -71,7 +71,7 @@ func main() {
hot, unique := timing.HotPaths("GetAttr") hot, unique := timing.HotPaths("GetAttr")
top := 20 top := 20
start := len(hot)-top start := len(hot) - top
if start < 0 { if start < 0 {
start = 0 start = 0
} }
......
...@@ -27,4 +27,3 @@ func CheckSuccess(e os.Error) { ...@@ -27,4 +27,3 @@ func CheckSuccess(e os.Error) {
panic(fmt.Sprintf("Unexpected error: %v", e)) panic(fmt.Sprintf("Unexpected error: %v", e))
} }
} }
...@@ -223,5 +223,3 @@ func (me *MultiZipFs) Create(name string, flags uint32, mode uint32) (file fuse. ...@@ -223,5 +223,3 @@ func (me *MultiZipFs) Create(name string, flags uint32, mode uint32) (file fuse.
return z, fuse.OK return z, fuse.OK
} }
...@@ -23,7 +23,7 @@ func TestMultiZipFs(t *testing.T) { ...@@ -23,7 +23,7 @@ func TestMultiZipFs(t *testing.T) {
go state.Loop(true) go state.Loop(true)
f, err := os.Open(mountPoint + "", os.O_RDONLY, 0) f, err := os.Open(mountPoint+"", os.O_RDONLY, 0)
CheckSuccess(err) CheckSuccess(err)
names, err := f.Readdirnames(-1) names, err := f.Readdirnames(-1)
...@@ -35,16 +35,16 @@ func TestMultiZipFs(t *testing.T) { ...@@ -35,16 +35,16 @@ func TestMultiZipFs(t *testing.T) {
err = f.Close() err = f.Close()
CheckSuccess(err) CheckSuccess(err)
f, err = os.Open(mountPoint + "/random", os.O_WRONLY | os.O_CREATE, 0) f, err = os.Open(mountPoint+"/random", os.O_WRONLY|os.O_CREATE, 0)
if err == nil { if err == nil {
t.Error("Must fail writing in root.") t.Error("Must fail writing in root.")
} }
f, err = os.Open(mountPoint + "/config/zipmount", os.O_WRONLY, 0) f, err = os.Open(mountPoint+"/config/zipmount", os.O_WRONLY, 0)
if err == nil { if err == nil {
t.Error("Must fail without O_CREATE") t.Error("Must fail without O_CREATE")
} }
f, err = os.Open(mountPoint + "/config/zipmount", os.O_WRONLY | os.O_CREATE, 0) f, err = os.Open(mountPoint+"/config/zipmount", os.O_WRONLY|os.O_CREATE, 0)
CheckSuccess(err) CheckSuccess(err)
// Directory exists, but is empty. // Directory exists, but is empty.
......
...@@ -43,7 +43,7 @@ func TestZipFs(t *testing.T) { ...@@ -43,7 +43,7 @@ func TestZipFs(t *testing.T) {
t.Error("file type", fi) t.Error("file type", fi)
} }
f, err := os.Open(mountPoint + "/file.txt", os.O_RDONLY, 0) f, err := os.Open(mountPoint+"/file.txt", os.O_RDONLY, 0)
CheckSuccess(err) CheckSuccess(err)
b := make([]byte, 1024) b := make([]byte, 1024)
......
...@@ -254,7 +254,7 @@ func (me *MountState) Stats() string { ...@@ -254,7 +254,7 @@ func (me *MountState) Stats() string {
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
// Logic for the control loop. // Logic for the control loop.
func (me *MountState) newFuseRequest() (*fuseRequest) { func (me *MountState) newFuseRequest() *fuseRequest {
req := new(fuseRequest) req := new(fuseRequest)
req.status = OK req.status = OK
req.inputBuf = me.buffers.AllocBuffer(bufSize) req.inputBuf = me.buffers.AllocBuffer(bufSize)
......
...@@ -18,7 +18,7 @@ import ( ...@@ -18,7 +18,7 @@ import (
// Make a temporary directory securely. // Make a temporary directory securely.
func MakeTempDir() string { func MakeTempDir() string {
nm, err := ioutil.TempDir("", "go-fuse"); nm, err := ioutil.TempDir("", "go-fuse")
if err != nil { if err != nil {
panic("TempDir() failed: " + err.String()) panic("TempDir() failed: " + err.String())
} }
......
...@@ -53,7 +53,7 @@ func mount(mountPoint string) (f *os.File, finalMountPoint string, err os.Error) ...@@ -53,7 +53,7 @@ func mount(mountPoint string) (f *os.File, finalMountPoint string, err os.Error)
proc, err := os.StartProcess("/bin/fusermount", proc, err := os.StartProcess("/bin/fusermount",
[]string{"/bin/fusermount", mountPoint}, []string{"/bin/fusermount", mountPoint},
&os.ProcAttr{ &os.ProcAttr{
Env:[]string{"_FUSE_COMMFD=3"}, Env: []string{"_FUSE_COMMFD=3"},
Files: []*os.File{os.Stdin, os.Stdout, os.Stderr, remote}}) Files: []*os.File{os.Stdin, os.Stdout, os.Stderr, remote}})
if err != nil { if err != nil {
......
...@@ -170,4 +170,3 @@ func (me *TimingRawFilesystem) ReleaseDir(header *InHeader, f RawFuseDir) { ...@@ -170,4 +170,3 @@ func (me *TimingRawFilesystem) ReleaseDir(header *InHeader, f RawFuseDir) {
defer me.startTimer("ReleaseDir")() defer me.startTimer("ReleaseDir")()
me.original.ReleaseDir(header, f) me.original.ReleaseDir(header, f)
} }
...@@ -188,6 +188,3 @@ func (me *WrappingRawFilesystem) Release(header *InHeader, f RawFuseFile) { ...@@ -188,6 +188,3 @@ func (me *WrappingRawFilesystem) Release(header *InHeader, f RawFuseFile) {
func (me *WrappingRawFilesystem) ReleaseDir(header *InHeader, f RawFuseDir) { func (me *WrappingRawFilesystem) ReleaseDir(header *InHeader, f RawFuseDir) {
me.original.ReleaseDir(header, f) me.original.ReleaseDir(header, f)
} }
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