12087: Don't report read/write errors on terminated sessions.
[arvados.git] / services / fuse / arvados_fuse / fresh.py
index 43f53c9b1d390b95b208fa6a737315fe40e8db5f..a51dd909b690df3cb39865d021b8f4daea4b471b 100644 (file)
@@ -1,3 +1,7 @@
+# Copyright (C) The Arvados Authors. All rights reserved.
+#
+# SPDX-License-Identifier: AGPL-3.0
+
 import time
 import ciso8601
 import calendar
@@ -115,8 +119,17 @@ class FreshBase(object):
         self.ref_count -= n
         return self.ref_count
 
-    def has_ref(self, only_children=False):
-        return self.ref_count > 0
+    def has_ref(self, only_children):
+        """Determine if there are any kernel references to this
+        object or its children.
+
+        If only_children is True, ignore refcount of self and only consider
+        children.
+        """
+        if only_children:
+            return False
+        else:
+            return self.ref_count > 0
 
     def objsize(self):
         return 0
@@ -126,3 +139,6 @@ class FreshBase(object):
 
     def finalize(self):
         pass
+
+    def child_event(self, ev):
+        pass