Skip to content

Commit

Permalink
move internal node when renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislusf committed Apr 17, 2021
1 parent e426e83 commit 787d297
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions fs/serve.go
Original file line number Diff line number Diff line change
Expand Up @@ -1756,6 +1756,18 @@ func (s *Server) delNodeId(node Node) {
delete(s.nodeRef, node)
}

func (s *Server) InvalidateInternalNode(oldNode Node, newNode Node, callbackFn func(internalNode Node)) {
s.meta.Lock()
id, ok := s.getNodeId(oldNode)
if ok {
snode := s.node[id]
callbackFn(snode.node)
s.setNodeId(newNode, id)
s.delNodeId(oldNode)
}
s.meta.Unlock()
}

func (s *Server) invalidateNode(node Node, off int64, size int64) error {
s.meta.Lock()
id, ok := s.getNodeId(node)
Expand Down

0 comments on commit 787d297

Please sign in to comment.