aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/inode_to_path.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-02-13 03:09:24 -0800
committerchrislu <chris.lu@gmail.com>2022-02-13 03:09:24 -0800
commit6a42cb6b0bf1b96fce06af06e418845ca288ac0f (patch)
tree5062b18aa24fb30b2f9d96d24a56b680d7121543 /weed/mount/inode_to_path.go
parent813b868b9ad8d22e05acc3f2003a9c196cdd83b5 (diff)
downloadseaweedfs-6a42cb6b0bf1b96fce06af06e418845ca288ac0f.tar.xz
seaweedfs-6a42cb6b0bf1b96fce06af06e418845ca288ac0f.zip
supports mknod, unlink
Diffstat (limited to 'weed/mount/inode_to_path.go')
-rw-r--r--weed/mount/inode_to_path.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go
index e3fabb422..21e6c867c 100644
--- a/weed/mount/inode_to_path.go
+++ b/weed/mount/inode_to_path.go
@@ -69,3 +69,16 @@ func (i *InodeToPath) HasInode(inode uint64) bool {
_, found := i.inode2path[inode]
return found
}
+
+func (i *InodeToPath) RemovePath(path util.FullPath) {
+ if path == "/" {
+ return
+ }
+ i.Lock()
+ defer i.Unlock()
+ inode, found := i.path2inode[path]
+ if found {
+ delete(i.path2inode, path)
+ delete(i.inode2path, inode)
+ }
+}