Commit 76e5775e authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse: call OnUnmount() for unmounting FUSE too

parent b20262de
...@@ -38,6 +38,8 @@ type FileSystemConnector struct { ...@@ -38,6 +38,8 @@ type FileSystemConnector struct {
// Callbacks for talking back to the kernel. // Callbacks for talking back to the kernel.
fsInit RawFsInit fsInit RawFsInit
nodeFs NodeFileSystem
// Translate between uint64 handles and *Inode. // Translate between uint64 handles and *Inode.
inodeMap HandleMap inodeMap HandleMap
...@@ -62,6 +64,7 @@ func NewFileSystemConnector(nodeFs NodeFileSystem, opts *FileSystemOptions) (c * ...@@ -62,6 +64,7 @@ func NewFileSystemConnector(nodeFs NodeFileSystem, opts *FileSystemOptions) (c *
if opts == nil { if opts == nil {
opts = NewFileSystemOptions() opts = NewFileSystemOptions()
} }
c.nodeFs = nodeFs
c.inodeMap = NewHandleMap(opts.PortableInodes) c.inodeMap = NewHandleMap(opts.PortableInodes)
c.rootNode = newInode(true, nodeFs.Root()) c.rootNode = newInode(true, nodeFs.Root())
...@@ -124,7 +127,10 @@ func (c *FileSystemConnector) lookupUpdate(node *Inode) (id uint64) { ...@@ -124,7 +127,10 @@ func (c *FileSystemConnector) lookupUpdate(node *Inode) (id uint64) {
// Must run outside treeLock. // Must run outside treeLock.
func (c *FileSystemConnector) forgetUpdate(nodeID uint64, forgetCount int) { func (c *FileSystemConnector) forgetUpdate(nodeID uint64, forgetCount int) {
if nodeID == raw.FUSE_ROOT_ID { if nodeID == raw.FUSE_ROOT_ID {
// We never got a lookup for root, so don't try to forget root. c.nodeFs.OnUnmount()
// We never got a lookup for root, so don't try to
// forget root.
return return
} }
......
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