diff options
| author | chrislu <chris.lu@gmail.com> | 2022-02-13 03:31:47 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-02-13 03:31:47 -0800 |
| commit | 3d93570979967b685145c7126098a419eda9fc29 (patch) | |
| tree | f4880de64cf47172f101f7abc2296892796c2635 /weed/mount/inode_to_path.go | |
| parent | 6a42cb6b0bf1b96fce06af06e418845ca288ac0f (diff) | |
| download | seaweedfs-3d93570979967b685145c7126098a419eda9fc29.tar.xz seaweedfs-3d93570979967b685145c7126098a419eda9fc29.zip | |
supports forget
Diffstat (limited to 'weed/mount/inode_to_path.go')
| -rw-r--r-- | weed/mount/inode_to_path.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go index 21e6c867c..6650f2380 100644 --- a/weed/mount/inode_to_path.go +++ b/weed/mount/inode_to_path.go @@ -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) + } +} |
