mount: rename also invalidate source inode

This commit is contained in:
chrislu
2022-07-08 19:07:03 -07:00
parent 48382676d2
commit d685b94102
2 changed files with 11 additions and 5 deletions

View File

@@ -152,7 +152,7 @@ func (i *InodeToPath) RemovePath(path util.FullPath) {
}
}
func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) (replacedInode uint64) {
func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) (sourceInode, targetInode uint64) {
i.Lock()
defer i.Unlock()
sourceInode, sourceFound := i.path2inode[sourcePath]
@@ -178,7 +178,7 @@ func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) (replacedIn
} else {
glog.Errorf("MovePath %s to %s: sourceInode %d not found", sourcePath, targetPath, sourceInode)
}
return targetInode
return
}
func (i *InodeToPath) Forget(inode, nlookup uint64, onForgetDir func(dir util.FullPath)) {