summaryrefslogtreecommitdiff
path: root/libdiskfs/node-nputl.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/node-nputl.c')
-rw-r--r--libdiskfs/node-nputl.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libdiskfs/node-nputl.c b/libdiskfs/node-nputl.c
index 19596654..8dac16e3 100644
--- a/libdiskfs/node-nputl.c
+++ b/libdiskfs/node-nputl.c
@@ -25,14 +25,10 @@
void
diskfs_nput_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)
diskfs_drop_node (np);
else
- {
- pthread_spin_unlock (&diskfs_node_refcnt_lock);
- pthread_mutex_unlock (&np->lock);
- }
+ pthread_mutex_unlock (&np->lock);
}