aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/inode_to_path.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-07-23 13:21:42 -0700
committerchrislu <chris.lu@gmail.com>2022-07-23 13:21:42 -0700
commit02c2d81cde7cc35a8f86947591ff51199abf45f9 (patch)
tree032d0c99ce3b66b4babe84c156489bb0db884de2 /weed/mount/inode_to_path.go
parent4d5dc557664b9bdf377c0fb560f9a13bc717d13f (diff)
downloadseaweedfs-02c2d81cde7cc35a8f86947591ff51199abf45f9.tar.xz
seaweedfs-02c2d81cde7cc35a8f86947591ff51199abf45f9.zip
fix removePathFromInode2Path
Diffstat (limited to 'weed/mount/inode_to_path.go')
-rw-r--r--weed/mount/inode_to_path.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go
index 79c016a15..39733a1fe 100644
--- a/weed/mount/inode_to_path.go
+++ b/weed/mount/inode_to_path.go
@@ -174,10 +174,15 @@ func (i *InodeToPath) RemovePath(path util.FullPath) {
}
func (i *InodeToPath) removePathFromInode2Path(inode uint64, path util.FullPath) {
- if ie, found := i.inode2path[inode]; found {
- if ie.removeOnePath(path) && len(ie.paths) == 0 {
- delete(i.inode2path, inode)
- }
+ ie, found := i.inode2path[inode]
+ if !found {
+ return
+ }
+ if !ie.removeOnePath(path) {
+ return
+ }
+ if len(ie.paths) == 0 {
+ delete(i.inode2path, inode)
}
}