Commit 0866f202 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Do not scan for workspaces on Readdir.

Finding the workspace for a given backing store is a common operation
that requires readdir, and should not be expensive.
parent fdcdc774
...@@ -332,7 +332,6 @@ func (me *AutoUnionFs) OpenDir(name string) (stream chan fuse.DirEntry, status f ...@@ -332,7 +332,6 @@ func (me *AutoUnionFs) OpenDir(name string) (stream chan fuse.DirEntry, status f
case _STATUS: case _STATUS:
return me.StatusDir() return me.StatusDir()
case _CONFIG: case _CONFIG:
me.updateKnownFses()
case "/": case "/":
name = "" name = ""
case "": case "":
......
...@@ -90,6 +90,12 @@ func TestAutoFsSymlink(t *testing.T) { ...@@ -90,6 +90,12 @@ func TestAutoFsSymlink(t *testing.T) {
log.Println("sleeping...") log.Println("sleeping...")
time.Sleep(2 * entryTtl * 1e9) time.Sleep(2 * entryTtl * 1e9)
scan := wd + "/mount/config/" + _SCAN_CONFIG
err = ioutil.WriteFile(scan, []byte("something"), 0644 )
if err != nil {
t.Error("error writing:", err)
}
fi, _ = os.Lstat(wd + "/mount/manual1") fi, _ = os.Lstat(wd + "/mount/manual1")
if fi != nil { if fi != nil {
t.Error("Should not have file:", fi) t.Error("Should not have file:", fi)
......
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