13064: Check has_ref before checking in_use
authorPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 22 Feb 2018 19:09:33 +0000 (14:09 -0500)
committerPeter Amstutz <pamstutz@veritasgenetics.com>
Thu, 22 Feb 2018 19:09:33 +0000 (14:09 -0500)
commit6509f6ec0a997f74b9992b8ef9acb7ae0dbd8c7a
treeab54e65ce929314da9b1b4daa007729de349aea6
parentb77a0df5575eb4d75b21b5c400fc8570efc97cea
13064: Check has_ref before checking in_use

Kernel behavior seems to be that if a file is referenced, its parents
remain referenced too.  This means has_ref() exits early when a
collection is not candidate for eviction.

By contrast, in_use() doesn't increment references on parents, so it
requires a full tree walk to determine if a collection is a candidate
for eviction.

Switching the order of the checks retains correctness but greatly
improves real-world performance.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz@veritasgenetics.com>
services/fuse/arvados_fuse/__init__.py