Mark all node types as non-deletable.
Otherwise, under memory pressure, the kernel will issue FORGET
messages causing the nodes to be removed.
Change-Id: Id26000838393a7a809725ae3de5968bb84455a18
diff --git a/fs/gitilesfs.go b/fs/gitilesfs.go
index 34baf5f..984ac29 100644
--- a/fs/gitilesfs.go
+++ b/fs/gitilesfs.go
@@ -56,6 +56,8 @@
linkTarget []byte
}
+func (n *linkNode) Deletable() bool { return false }
+
func newLinkNode(target string) *linkNode {
return &linkNode{
Node: nodefs.NewDefaultNode(),
@@ -214,6 +216,8 @@
return nodefs.NewDataFile(d.data), fuse.OK
}
+func (n *dataNode) Deletable() bool { return false }
+
func newDataNode(c []byte) nodefs.Node {
return &dataNode{nodefs.NewDefaultNode(), c}
}
@@ -233,6 +237,8 @@
return r
}
+func (r *gitilesRoot) Deletable() bool { return false }
+
func (r *gitilesRoot) OnMount(fsConn *nodefs.FileSystemConnector) {
if err := r.onMount(fsConn); err != nil {
log.Printf("onMount: %v", err)
diff --git a/fs/manifestfs.go b/fs/manifestfs.go
index f2e2591..fe759c9 100644
--- a/fs/manifestfs.go
+++ b/fs/manifestfs.go
@@ -41,6 +41,8 @@
manifestXML []byte
}
+func (r *manifestFSRoot) Deletable() bool { return false }
+
// NewManifestFS creates a Manifest FS root node.
func NewManifestFS(service *gitiles.Service, cache *cache.Cache, opts ManifestOptions) (nodefs.Node, error) {
xml, err := opts.Manifest.MarshalXML()
diff --git a/fs/multifs.go b/fs/multifs.go
index 962b3b7..c9887b0 100644
--- a/fs/multifs.go
+++ b/fs/multifs.go
@@ -42,6 +42,8 @@
})
}
+func (r *configNode) Deletable() bool { return false }
+
func NewMultiFS(service *gitiles.Service, c *cache.Cache, options MultiFSOptions) *multiManifestFSRoot {
r := &multiManifestFSRoot{
Node: nodefs.NewDefaultNode(),
@@ -52,6 +54,8 @@
return r
}
+func (r *multiManifestFSRoot) Deletable() bool { return false }
+
type configNode struct {
nodefs.Node
root *multiManifestFSRoot
@@ -71,6 +75,8 @@
return c.link, fuse.OK
}
+func (r *configEntryNode) Deletable() bool { return false }
+
func (c *configNode) Unlink(name string, ctx *fuse.Context) fuse.Status {
child := c.root.Inode().RmChild(name)
if child == nil {