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

Fix autounion.go

parent e093cf0f
......@@ -29,7 +29,9 @@ type PathNodeFs struct {
func (me *PathNodeFs) Mount(path string, nodeFs NodeFileSystem, opts *FileSystemOptions) Status {
dir, name := filepath.Split(path)
dir = filepath.Clean(dir)
if dir != "" {
dir = filepath.Clean(dir)
}
parent := me.Node(dir)
if parent == nil {
return ENOENT
......
......@@ -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())
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() {
me.knownFileSystems[name] = knownFs{
ufs,
......@@ -131,7 +131,7 @@ func (me *AutoUnionFs) rmFs(name string) (code fuse.Status) {
return fuse.ENOENT
}
code = me.nodeFs.Unmount(known.PathNodeFs.Root().Inode())
code = me.nodeFs.Unmount(name)
if code.Ok() {
me.knownFileSystems[name] = knownFs{}, 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