Commit 47d385f2 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Add OnForget to FsNode interface.

parent 55831d20
......@@ -28,10 +28,13 @@ type FsNode interface {
Inode() *Inode
SetInode(node *Inode)
// RmChild and AddChild run inside the critical section for
// the mutex behind Inode().LockTree().
RmChild(name string, child FsNode)
AddChild(name string, child FsNode)
Lookup(name string) (fi *os.FileInfo, node FsNode, code Status)
OnForget()
// Misc.
Access(mode uint32, context *Context) (code Status)
......
......@@ -40,6 +40,9 @@ func (me *DefaultFsNode) Inode() *Inode {
return me.inode
}
func (me *DefaultFsNode) OnForget() {
}
func (me *DefaultFsNode) RmChild(name string, child FsNode) {
}
......
......@@ -139,6 +139,7 @@ func (me *FileSystemConnector) considerDropInode(n *Inode) (drop bool) {
if ch == nil {
panic(fmt.Sprintf("trying to del child %q, but not present", k))
}
ch.fsInode.OnForget()
me.inodeMap.Forget(ch.nodeId)
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment