Commit 81e133bf authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Don't try to drop inodes on ReleaseDir().

Dropping inodes is expensive (it looks through the entire tree), while
opendir/readdir/releasedir should be cheap.
parent 107f26da
......@@ -144,13 +144,8 @@ func (c *FileSystemConnector) InodeHandleCount() int {
return c.inodeMap.Count()
}
func (c *FileSystemConnector) considerDropInode(node *Inode) {
node.treeLock.Lock()
c.recursiveConsiderDropInode(node)
node.treeLock.Unlock()
}
// Must hold treeLock.
func (c *FileSystemConnector) recursiveConsiderDropInode(n *Inode) (drop bool) {
delChildren := []string{}
for k, v := range n.children {
......
......@@ -298,7 +298,6 @@ func (c *FileSystemConnector) ReleaseDir(header *raw.InHeader, input *raw.Releas
node := c.toInode(header.NodeId)
opened := node.mount.unregisterFileHandle(input.Fh, node)
opened.dir.Release()
c.considerDropInode(node)
}
func (c *FileSystemConnector) GetXAttrSize(header *raw.InHeader, attribute string) (sz int, code Status) {
......
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