Commit 34673e47 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/nodefs: Reuse node ID in Unmount

parent a95445ae
...@@ -298,7 +298,7 @@ func (c *FileSystemConnector) Unmount(node *Inode) fuse.Status { ...@@ -298,7 +298,7 @@ func (c *FileSystemConnector) Unmount(node *Inode) fuse.Status {
return fuse.EINVAL return fuse.EINVAL
} }
nodeId := c.inodeMap.Handle(&node.handled) nodeID := c.inodeMap.Handle(&node.handled)
// Must lock parent to update tree structure. // Must lock parent to update tree structure.
parentNode := node.mountPoint.parentInode parentNode := node.mountPoint.parentInode
...@@ -336,7 +336,7 @@ func (c *FileSystemConnector) Unmount(node *Inode) fuse.Status { ...@@ -336,7 +336,7 @@ func (c *FileSystemConnector) Unmount(node *Inode) fuse.Status {
// We have to wait until the kernel has forgotten the // We have to wait until the kernel has forgotten the
// mountpoint, so the write to node.mountPoint is no longer // mountpoint, so the write to node.mountPoint is no longer
// racy. // racy.
code := c.server.DeleteNotify(parentId, c.inodeMap.Handle(&node.handled), name) code := c.server.DeleteNotify(parentId, nodeID, name)
if code.Ok() { if code.Ok() {
mount.treeLock.Unlock() mount.treeLock.Unlock()
parentNode.mount.treeLock.Unlock() parentNode.mount.treeLock.Unlock()
...@@ -347,7 +347,7 @@ func (c *FileSystemConnector) Unmount(node *Inode) fuse.Status { ...@@ -347,7 +347,7 @@ func (c *FileSystemConnector) Unmount(node *Inode) fuse.Status {
// contention. // contention.
time.Sleep(delay) time.Sleep(delay)
delay = delay * 2 delay = delay * 2
if !c.inodeMap.Has(nodeId) { if !c.inodeMap.Has(nodeID) {
break break
} }
......
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