aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-07-24 13:43:11 -0700
committerchrislu <chris.lu@gmail.com>2022-07-24 13:43:11 -0700
commit40089b6753b78f45abd213a0da7750541edd6b24 (patch)
tree0fa5e9688edc1bff86627400024d8c0b6d426555
parentd24db396cc845518dbc5fad32011e5d174354b62 (diff)
downloadseaweedfs-40089b6753b78f45abd213a0da7750541edd6b24.tar.xz
seaweedfs-40089b6753b78f45abd213a0da7750541edd6b24.zip
maintain node lookup counter
-rw-r--r--weed/mount/inode_to_path.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go
index dd125f250..0c34b2ab4 100644
--- a/weed/mount/inode_to_path.go
+++ b/weed/mount/inode_to_path.go
@@ -38,6 +38,7 @@ func (ie *InodeEntry) removeOnePath(p util.FullPath) bool {
ie.paths[x] = ie.paths[x+1]
}
ie.paths = ie.paths[0 : len(ie.paths)-1]
+ ie.nlookup--
return true
}
@@ -171,6 +172,7 @@ func (i *InodeToPath) AddPath(inode uint64, path util.FullPath) {
ie, found := i.inode2path[inode]
if found {
ie.paths = append(ie.paths, path)
+ ie.nlookup++
} else {
i.inode2path[inode] = &InodeEntry{
paths: []util.FullPath{path},