summaryrefslogtreecommitdiff
path: root/libdiskfs/node-nrelel.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/node-nrelel.c')
-rw-r--r--libdiskfs/node-nrelel.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/libdiskfs/node-nrelel.c b/libdiskfs/node-nrelel.c
index ee53b227..dc4f920f 100644
--- a/libdiskfs/node-nrelel.c
+++ b/libdiskfs/node-nrelel.c
@@ -26,14 +26,11 @@
void
diskfs_nrele_light (struct node *np)
{
- pthread_spin_lock (&diskfs_node_refcnt_lock);
- assert (np->light_references);
- np->light_references--;
- if (np->references + np->light_references == 0)
+ struct references result;
+ refcounts_deref_weak (&np->refcounts, &result);
+ if (result.hard == 0 && result.weak == 0)
{
pthread_mutex_lock (&np->lock);
diskfs_drop_node (np);
}
- else
- pthread_spin_unlock (&diskfs_node_refcnt_lock);
}