Commit 854cacde authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Fix autounion.go

parent e093cf0f
...@@ -29,7 +29,9 @@ type PathNodeFs struct { ...@@ -29,7 +29,9 @@ type PathNodeFs struct {
func (me *PathNodeFs) Mount(path string, nodeFs NodeFileSystem, opts *FileSystemOptions) Status { func (me *PathNodeFs) Mount(path string, nodeFs NodeFileSystem, opts *FileSystemOptions) Status {
dir, name := filepath.Split(path) dir, name := filepath.Split(path)
if dir != "" {
dir = filepath.Clean(dir) dir = filepath.Clean(dir)
}
parent := me.Node(dir) parent := me.Node(dir)
if parent == nil { if parent == nil {
return ENOENT return ENOENT
......
...@@ -111,7 +111,7 @@ func (me *AutoUnionFs) createFs(name string, roots []string) fuse.Status { ...@@ -111,7 +111,7 @@ func (me *AutoUnionFs) createFs(name string, roots []string) fuse.Status {
log.Printf("Adding workspace %v for roots %v", name, ufs.Name()) log.Printf("Adding workspace %v for roots %v", name, ufs.Name())
nfs := fuse.NewPathNodeFs(ufs) nfs := fuse.NewPathNodeFs(ufs)
code := me.nodeFs.Mount(me.nodeFs.Root().Inode(), name, nfs, &me.options.FileSystemOptions) code := me.nodeFs.Mount(name, nfs, &me.options.FileSystemOptions)
if code.Ok() { if code.Ok() {
me.knownFileSystems[name] = knownFs{ me.knownFileSystems[name] = knownFs{
ufs, ufs,
...@@ -131,7 +131,7 @@ func (me *AutoUnionFs) rmFs(name string) (code fuse.Status) { ...@@ -131,7 +131,7 @@ func (me *AutoUnionFs) rmFs(name string) (code fuse.Status) {
return fuse.ENOENT return fuse.ENOENT
} }
code = me.nodeFs.Unmount(known.PathNodeFs.Root().Inode()) code = me.nodeFs.Unmount(name)
if code.Ok() { if code.Ok() {
me.knownFileSystems[name] = knownFs{}, false me.knownFileSystems[name] = knownFs{}, false
me.nameRootMap[name] = "", false me.nameRootMap[name] = "", false
......
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