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