supports forget

This commit is contained in:
chrislu
2022-02-13 03:31:47 -08:00
parent 6a42cb6b0b
commit 3d93570979
3 changed files with 65 additions and 0 deletions

View File

@@ -82,3 +82,15 @@ func (i *InodeToPath) RemovePath(path util.FullPath) {
delete(i.inode2path, inode)
}
}
func (i *InodeToPath) RemoveInode(inode uint64) {
if inode == 1 {
return
}
i.RLock()
defer i.RUnlock()
path, found := i.inode2path[inode]
if found {
delete(i.path2inode, path)
delete(i.inode2path, inode)
}
}