Commit 8e70889f authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

gofmt.

parent a4af95ae
...@@ -36,9 +36,9 @@ func setupFs(fs fuse.FileSystem) (string, func()) { ...@@ -36,9 +36,9 @@ func setupFs(fs fuse.FileSystem) (string, func()) {
lc, lns := state.Latencies().Get("LOOKUP") lc, lns := state.Latencies().Get("LOOKUP")
gc, gns := state.Latencies().Get("GETATTR") gc, gns := state.Latencies().Get("GETATTR")
fmt.Printf("GETATTR %dus/call n=%d, LOOKUP %dus/call n=%d\n", fmt.Printf("GETATTR %dus/call n=%d, LOOKUP %dus/call n=%d\n",
gns / int64(1000 * lc), gc, gns/int64(1000*lc), gc,
lns / int64(1000 * lc), lc) lns/int64(1000*lc), lc)
err := state.Unmount() err := state.Unmount()
if err != nil { if err != nil {
log.Println("error during unmount", err) log.Println("error during unmount", err)
...@@ -115,7 +115,7 @@ func TestingBOnePass(b *testing.B, threads int, files []string) (results []float ...@@ -115,7 +115,7 @@ func TestingBOnePass(b *testing.B, threads int, files []string) (results []float
runtime.GC() runtime.GC()
var before, after runtime.MemStats var before, after runtime.MemStats
runtime.ReadMemStats(&before) runtime.ReadMemStats(&before)
todo := b.N todo := b.N
for todo > 0 { for todo > 0 {
if len(files) > todo { if len(files) > todo {
...@@ -128,7 +128,7 @@ func TestingBOnePass(b *testing.B, threads int, files []string) (results []float ...@@ -128,7 +128,7 @@ func TestingBOnePass(b *testing.B, threads int, files []string) (results []float
results = append(results, result) results = append(results, result)
} }
runtime.ReadMemStats(&after) runtime.ReadMemStats(&after)
fmt.Printf("GC count %d, total GC time: %d ns/file\n", fmt.Printf("GC count %d, total GC time: %d ns/file\n",
after.NumGC-before.NumGC, (after.PauseTotalNs-before.PauseTotalNs)/uint64(b.N)) after.NumGC-before.NumGC, (after.PauseTotalNs-before.PauseTotalNs)/uint64(b.N))
return results return results
......
...@@ -15,7 +15,6 @@ import ( ...@@ -15,7 +15,6 @@ import (
var _ = log.Println var _ = log.Println
func (c *FileSystemConnector) String() string { func (c *FileSystemConnector) String() string {
if c.rootNode == nil || c.rootNode.mount == nil { if c.rootNode == nil || c.rootNode.mount == nil {
return "go-fuse:unmounted" return "go-fuse:unmounted"
......
...@@ -11,7 +11,7 @@ type latencyMapEntry struct { ...@@ -11,7 +11,7 @@ type latencyMapEntry struct {
type LatencyMap struct { type LatencyMap struct {
sync.Mutex sync.Mutex
stats map[string]*latencyMapEntry stats map[string]*latencyMapEntry
} }
func NewLatencyMap() *LatencyMap { func NewLatencyMap() *LatencyMap {
......
...@@ -94,7 +94,7 @@ func (ms *MountState) Mount(mountPoint string, opts *MountOptions) error { ...@@ -94,7 +94,7 @@ func (ms *MountState) Mount(mountPoint string, opts *MountOptions) error {
} }
name = strings.Replace(name[:l], ",", ";", -1) name = strings.Replace(name[:l], ",", ";", -1)
} }
optStrs = append(optStrs, "subtype=" + name) optStrs = append(optStrs, "subtype="+name)
file, mp, err := mount(mountPoint, strings.Join(optStrs, ",")) file, mp, err := mount(mountPoint, strings.Join(optStrs, ","))
if err != nil { if err != nil {
......
...@@ -20,7 +20,7 @@ var _ = log.Println ...@@ -20,7 +20,7 @@ var _ = log.Println
type DelayFs struct { type DelayFs struct {
DefaultFileSystem DefaultFileSystem
fileRegex *regexp.Regexp fileRegex *regexp.Regexp
dirRegex *regexp.Regexp dirRegex *regexp.Regexp
} }
...@@ -38,7 +38,7 @@ func (d *DelayFs) GetAttr(name string, c *Context) (*Attr, Status) { ...@@ -38,7 +38,7 @@ func (d *DelayFs) GetAttr(name string, c *Context) (*Attr, Status) {
func TestMemoryPressure(t *testing.T) { func TestMemoryPressure(t *testing.T) {
fs := &DelayFs{ fs := &DelayFs{
fileRegex: regexp.MustCompile("^dir[0-9]*/file[0-9]*$"), fileRegex: regexp.MustCompile("^dir[0-9]*/file[0-9]*$"),
dirRegex: regexp.MustCompile("^dir[0-9]*$"), dirRegex: regexp.MustCompile("^dir[0-9]*$"),
} }
dir, err := ioutil.TempDir("", "go-fuse") dir, err := ioutil.TempDir("", "go-fuse")
......
...@@ -62,7 +62,7 @@ func (me *pairPool) used() (n int) { ...@@ -62,7 +62,7 @@ func (me *pairPool) used() (n int) {
func (me *pairPool) total() int { func (me *pairPool) total() int {
me.Lock() me.Lock()
n := me.usedCount + len(me.unused) n := me.usedCount + len(me.unused)
me.Unlock() me.Unlock()
return n return n
} }
......
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