From dc00a94df4a06764d822b29cbf35b532343821c8 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Tue, 6 May 2014 18:58:10 +0200 Subject: libdiskfs: lock-less reference counting for peropen objects * libdiskfs/diskfs.h (struct peropen): Use refcount_t for field refcnt. * libdiskfs/peropen-make.c (diskfs_make_peropen): Initialize refcnt. * libdiskfs/peropen-rele.c (diskfs_release_peropen): Adjust accordingly. * libdiskfs/protid-make.c (diskfs_start_protid): Likewise. Also, the node must no longer be locked, adjust comment accordingly. (diskfs_create_protid): Likewise. --- libdiskfs/peropen-make.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libdiskfs/peropen-make.c') diff --git a/libdiskfs/peropen-make.c b/libdiskfs/peropen-make.c index eba037ff..6d5ca014 100644 --- a/libdiskfs/peropen-make.c +++ b/libdiskfs/peropen-make.c @@ -31,7 +31,7 @@ diskfs_make_peropen (struct node *np, int flags, struct peropen *context, po->filepointer = 0; po->lock_status = LOCK_UN; - po->refcnt = 0; + refcount_init (&po->refcnt, 0); po->openstat = flags; po->np = np; po->path = NULL; -- cgit v1.2.3