Skip to content

Commit

Permalink
Do not scan for workspaces on Readdir.
Browse files Browse the repository at this point in the history
Finding the workspace for a given backing store is a common operation
that requires readdir, and should not be expensive.
  • Loading branch information
hanwen committed May 26, 2011
1 parent fdcdc77 commit 0866f20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion unionfs/autounion.go
Expand Up @@ -332,7 +332,6 @@ func (me *AutoUnionFs) OpenDir(name string) (stream chan fuse.DirEntry, status f
case _STATUS:
return me.StatusDir()
case _CONFIG:
me.updateKnownFses()
case "/":
name = ""
case "":
Expand Down
6 changes: 6 additions & 0 deletions unionfs/autounion_test.go
Expand Up @@ -90,6 +90,12 @@ func TestAutoFsSymlink(t *testing.T) {
log.Println("sleeping...")
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")
if fi != nil {
t.Error("Should not have file:", fi)
Expand Down

0 comments on commit 0866f20

Please sign in to comment.