mount2: invalidate fuse cache for replaced inode

This commit is contained in:
chrislu
2022-02-27 00:00:23 -08:00
parent 4ddcbaab57
commit 9ef5bb20f6
3 changed files with 14 additions and 2 deletions

View File

@@ -138,7 +138,7 @@ func (i *InodeToPath) RemovePath(path util.FullPath) {
}
}
func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) {
func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) (replacedInode uint64) {
i.Lock()
defer i.Unlock()
sourceInode, sourceFound := i.path2inode[sourcePath]
@@ -157,6 +157,7 @@ func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) {
} else {
i.inode2path[sourceInode].nlookup++
}
return targetInode
}
func (i *InodeToPath) Forget(inode, nlookup uint64, onForgetDir func(dir util.FullPath)) {