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 { ...@@ -144,13 +144,8 @@ func (c *FileSystemConnector) InodeHandleCount() int {
return c.inodeMap.Count() return c.inodeMap.Count()
} }
func (c *FileSystemConnector) considerDropInode(node *Inode) {
node.treeLock.Lock()
c.recursiveConsiderDropInode(node)
node.treeLock.Unlock()
}
// Must hold treeLock. // Must hold treeLock.
func (c *FileSystemConnector) recursiveConsiderDropInode(n *Inode) (drop bool) { func (c *FileSystemConnector) recursiveConsiderDropInode(n *Inode) (drop bool) {
delChildren := []string{} delChildren := []string{}
for k, v := range n.children { for k, v := range n.children {
......
...@@ -298,7 +298,6 @@ func (c *FileSystemConnector) ReleaseDir(header *raw.InHeader, input *raw.Releas ...@@ -298,7 +298,6 @@ func (c *FileSystemConnector) ReleaseDir(header *raw.InHeader, input *raw.Releas
node := c.toInode(header.NodeId) node := c.toInode(header.NodeId)
opened := node.mount.unregisterFileHandle(input.Fh, node) opened := node.mount.unregisterFileHandle(input.Fh, node)
opened.dir.Release() opened.dir.Release()
c.considerDropInode(node)
} }
func (c *FileSystemConnector) GetXAttrSize(header *raw.InHeader, attribute string) (sz int, code Status) { 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