X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/232cace27f60dbac0f46a9113a4b19a561689f4c..e19efd044f4aa88af59f35f43c9b1118df36efc0:/services/fuse/arvados_fuse/fresh.py diff --git a/services/fuse/arvados_fuse/fresh.py b/services/fuse/arvados_fuse/fresh.py index 532f110940..a51dd909b6 100644 --- a/services/fuse/arvados_fuse/fresh.py +++ b/services/fuse/arvados_fuse/fresh.py @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + import time import ciso8601 import calendar @@ -64,7 +68,6 @@ class FreshBase(object): self.use_count = 0 self.ref_count = 0 self.dead = False - self.cache_priority = None self.cache_size = 0 self.cache_uuid = None self.allow_attr_cache = True @@ -116,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 @@ -127,3 +139,6 @@ class FreshBase(object): def finalize(self): pass + + def child_event(self, ev): + pass