aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/inode_to_path.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-02-27 00:00:23 -0800
committerchrislu <chris.lu@gmail.com>2022-02-27 00:00:23 -0800
commit9ef5bb20f6cea962e2e521f183c1d2fa692a4a2b (patch)
tree2126870523c9dd15078aebd4129e9dd56428daf9 /weed/mount/inode_to_path.go
parent4ddcbaab573be19ec5b78b7ff4a9ebcb9cd1f605 (diff)
downloadseaweedfs-9ef5bb20f6cea962e2e521f183c1d2fa692a4a2b.tar.xz
seaweedfs-9ef5bb20f6cea962e2e521f183c1d2fa692a4a2b.zip
mount2: invalidate fuse cache for replaced inode
Diffstat (limited to 'weed/mount/inode_to_path.go')
-rw-r--r--weed/mount/inode_to_path.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/weed/mount/inode_to_path.go b/weed/mount/inode_to_path.go
index 156797b72..1e914dccd 100644
--- a/weed/mount/inode_to_path.go
+++ b/weed/mount/inode_to_path.go
@@ -138,7 +138,7 @@ func (i *InodeToPath) RemovePath(path util.FullPath) {
}
}
-func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) {
+func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) (replacedInode uint64) {
i.Lock()
defer i.Unlock()
sourceInode, sourceFound := i.path2inode[sourcePath]
@@ -157,6 +157,7 @@ func (i *InodeToPath) MovePath(sourcePath, targetPath util.FullPath) {
} else {
i.inode2path[sourceInode].nlookup++
}
+ return targetInode
}
func (i *InodeToPath) Forget(inode, nlookup uint64, onForgetDir func(dir util.FullPath)) {