diff options
Diffstat (limited to 'debian/patches/0003-libdiskfs-lock-less-reference-counting-for-peropen-o.patch')
-rw-r--r-- | debian/patches/0003-libdiskfs-lock-less-reference-counting-for-peropen-o.patch | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/debian/patches/0003-libdiskfs-lock-less-reference-counting-for-peropen-o.patch b/debian/patches/0003-libdiskfs-lock-less-reference-counting-for-peropen-o.patch index 04a9210c..fac34440 100644 --- a/debian/patches/0003-libdiskfs-lock-less-reference-counting-for-peropen-o.patch +++ b/debian/patches/0003-libdiskfs-lock-less-reference-counting-for-peropen-o.patch @@ -1,4 +1,4 @@ -From 124fef363dfd2326799dc884e4960a14f20b1e09 Mon Sep 17 00:00:00 2001 +From b3c7364a46a4be0871d49b3ba04bc2c7f8d2a717 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: [PATCH 3/4] libdiskfs: lock-less reference counting for peropen @@ -13,9 +13,9 @@ node must no longer be locked, adjust comment accordingly. --- libdiskfs/diskfs.h | 7 ++++--- libdiskfs/peropen-make.c | 2 +- - libdiskfs/peropen-rele.c | 11 +++-------- + libdiskfs/peropen-rele.c | 21 ++++++++++----------- libdiskfs/protid-make.c | 8 ++++---- - 4 files changed, 12 insertions(+), 16 deletions(-) + 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h index 8151ddc..ae1a150 100644 @@ -67,7 +67,7 @@ index eba037f..6d5ca01 100644 po->np = np; po->path = NULL; diff --git a/libdiskfs/peropen-rele.c b/libdiskfs/peropen-rele.c -index d3f7492..64cea18 100644 +index d3f7492..877137b 100644 --- a/libdiskfs/peropen-rele.c +++ b/libdiskfs/peropen-rele.c @@ -22,13 +22,8 @@ @@ -86,12 +86,22 @@ index d3f7492..64cea18 100644 if (po->root_parent) mach_port_deallocate (mach_task_self (), po->root_parent); -@@ -43,7 +38,7 @@ diskfs_release_peropen (struct peropen *po) - fshelp_acquire_lock (&po->np->userlock, &po->lock_status, - &po->np->lock, LOCK_UN); +@@ -40,10 +35,14 @@ diskfs_release_peropen (struct peropen *po) + mach_port_deallocate (mach_task_self (), po->shadow_root_parent); + if (po->lock_status != LOCK_UN) +- fshelp_acquire_lock (&po->np->userlock, &po->lock_status, +- &po->np->lock, LOCK_UN); +- - diskfs_nput (po->np); -+ diskfs_nrele (po->np); ++ { ++ pthread_mutex_lock (&po->np->lock); ++ fshelp_acquire_lock (&po->np->userlock, &po->lock_status, ++ &po->np->lock, LOCK_UN); ++ diskfs_nput (po->np); ++ } ++ else ++ diskfs_nrele (po->np); free (po->path); free (po); |