Commit 0776cb0f authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Drop the argument to Loop. Go-FUSE is always threaded.

parent 06650baf
......@@ -77,7 +77,7 @@ func setupFs(fs fuse.FileSystem, opts *fuse.FileSystemOptions) (string, func())
panic(fmt.Sprintf("cannot mount %v", err)) // ugh - benchmark has no error methods.
}
// state.Debug = true
go state.Loop(false)
go state.Loop()
return mountPoint, func() {
err := state.Unmount()
......
......@@ -11,7 +11,6 @@ import (
func main() {
version := flag.Bool("version", false, "print version number")
debug := flag.Bool("debug", false, "debug on")
threaded := flag.Bool("threaded", true, "threading on")
delcache_ttl := flag.Float64("deletion_cache_ttl", 5.0, "Deletion cache TTL in seconds.")
branchcache_ttl := flag.Float64("branchcache_ttl", 5.0, "Branch cache TTL in seconds.")
deldirname := flag.String(
......@@ -54,5 +53,5 @@ func main() {
pathfs.Debug = *debug
conn.Debug = *debug
state.Debug = *debug
state.Loop(*threaded)
state.Loop()
}
......@@ -56,5 +56,5 @@ func main() {
if err != nil {
log.Fatal("Mount fail: %v\n", err)
}
state.Loop(true)
state.Loop()
}
......@@ -19,7 +19,6 @@ func main() {
// Scans the arg list and sets up flags
debug := flag.Bool("debug", false, "print debugging messages.")
latencies := flag.Bool("latencies", false, "record latencies.")
threaded := flag.Bool("threaded", true, "switch off threading; print debugging messages.")
flag.Parse()
if flag.NArg() < 2 {
// TODO - where to get program name?
......@@ -77,5 +76,5 @@ func main() {
}
fmt.Println("Mounted!")
state.Loop(*threaded)
state.Loop()
}
......@@ -29,5 +29,5 @@ func main() {
}
state.Debug = *debug
state.Loop(true)
state.Loop()
}
......@@ -11,7 +11,6 @@ import (
func main() {
debug := flag.Bool("debug", false, "debug on")
threaded := flag.Bool("threaded", true, "debug on")
delcache_ttl := flag.Float64("deletion_cache_ttl", 5.0, "Deletion cache TTL in seconds.")
branchcache_ttl := flag.Float64("branchcache_ttl", 5.0, "Branch cache TTL in seconds.")
deldirname := flag.String(
......@@ -40,5 +39,5 @@ func main() {
}
mountState.Debug = *debug
mountState.Loop(*threaded)
mountState.Loop()
}
......@@ -37,5 +37,5 @@ func main() {
state.SetRecordStatistics(*latencies)
state.Debug = *debug
state.Loop(true)
state.Loop()
}
......@@ -40,7 +40,7 @@ func setupCacheTest() (string, *PathNodeFs, func()) {
state.Debug = true
conn.Debug = true
pfs.Debug = true
go state.Loop(false)
go state.Loop()
return dir, pfs, func() {
err := state.Unmount()
......@@ -124,7 +124,7 @@ func TestNonseekable(t *testing.T) {
state.Debug = true
defer state.Unmount()
go state.Loop(false)
go state.Loop()
f, err := os.Open(dir + "/file")
CheckSuccess(err)
......
......@@ -126,7 +126,7 @@ func setupFAttrTest(fs FileSystem) (dir string, clean func()) {
CheckSuccess(err)
state.Debug = true
go state.Loop(false)
go state.Loop()
// Trigger INIT.
os.Lstat(dir)
......
......@@ -88,7 +88,7 @@ func NewTestCase(t *testing.T) *testCase {
me.state.Debug = true
// Unthreaded, but in background.
go me.state.Loop(false)
go me.state.Loop()
return me
}
......@@ -707,7 +707,7 @@ func TestOriginalIsSymlink(t *testing.T) {
CheckSuccess(err)
defer state.Unmount()
go state.Loop(false)
go state.Loop()
_, err = os.Lstat(mnt)
CheckSuccess(err)
......
......@@ -153,9 +153,8 @@ func (me *MountState) recordStats(req *request) {
// and wait for it to exit, but tests will want to run this in a
// goroutine.
//
// If threaded is given, each filesystem operation executes in a
// separate goroutine.
func (me *MountState) Loop(unused bool) {
// Each filesystem operation executes in a separate goroutine.
func (me *MountState) Loop() {
me.loop()
me.mountFile.Close()
}
......
......@@ -55,7 +55,7 @@ func NewNotifyTest() *NotifyTest {
me.state, me.connector, err = MountNodeFileSystem(me.dir, me.pathfs, opts)
CheckSuccess(err)
me.state.Debug = true
go me.state.Loop(false)
go me.state.Loop()
return me
}
......
......@@ -30,7 +30,7 @@ func setupOwnerTest(opts *FileSystemOptions) (workdir string, cleanup func()) {
fs := &ownerFs{}
state, _, err := MountPathFileSystem(wd, fs, opts)
CheckSuccess(err)
go state.Loop(false)
go state.Loop()
return wd, func() {
state.Unmount()
os.RemoveAll(wd)
......
......@@ -21,7 +21,7 @@ func TestPathDebug(t *testing.T) {
state.Debug = true
defer state.Unmount()
go state.Loop(false)
go state.Loop()
dir := filepath.Join(mountPoint, ".debug")
_, err := os.Lstat(dir)
......
......@@ -99,7 +99,7 @@ func TestXAttrRead(t *testing.T) {
state.Debug = true
defer state.Unmount()
go state.Loop(false)
go state.Loop()
mounted := filepath.Join(mountPoint, nm)
_, err = os.Lstat(mounted)
......
......@@ -46,7 +46,7 @@ func setup(t *testing.T) (workdir string, cleanup func()) {
CheckSuccess(err)
state.Debug = true
conn.Debug = true
go state.Loop(false)
go state.Loop()
return wd, func() {
state.Unmount()
......
......@@ -58,7 +58,7 @@ func setupUfs(t *testing.T) (workdir string, cleanup func()) {
CheckSuccess(err)
conn.Debug = true
state.Debug = true
go state.Loop(false)
go state.Loop()
return wd, func() {
state.Unmount()
......@@ -851,7 +851,7 @@ func TestDisappearing(t *testing.T) {
CheckSuccess(err)
defer state.Unmount()
state.Debug = true
go state.Loop(true)
go state.Loop()
log.Println("TestDisappearing2")
......
......@@ -23,7 +23,7 @@ func setupMzfs() (mountPoint string, cleanup func()) {
})
CheckSuccess(err)
state.Debug = true
go state.Loop(true)
go state.Loop()
return mountPoint, func() {
state.Unmount()
......
......@@ -27,7 +27,7 @@ func setupZipfs() (mountPoint string, cleanup func()) {
state, _, err := fuse.MountNodeFileSystem(mountPoint, zfs, nil)
state.Debug = true
go state.Loop(false)
go state.Loop()
return mountPoint, func() {
state.Unmount()
......
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