summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-05-07 17:20:38 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-05-07 17:20:38 +0200
commit01c216d1f80f6db28677ed3a87aba81d728f8823 (patch)
tree83928a75b1296c2969b77a925e4e3abc85148ec5 /debian
parent95bfd7c8d8811c6cd183aa3baaa11dacd60dc5af (diff)
fix 0005-libtrivfs-lock-less-reference-counting-for-trivfs_pr.patch
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/0005-libtrivfs-lock-less-reference-counting-for-trivfs_pr.patch28
1 files changed, 12 insertions, 16 deletions
diff --git a/debian/patches/0005-libtrivfs-lock-less-reference-counting-for-trivfs_pr.patch b/debian/patches/0005-libtrivfs-lock-less-reference-counting-for-trivfs_pr.patch
index d32acdd0..917eece7 100644
--- a/debian/patches/0005-libtrivfs-lock-less-reference-counting-for-trivfs_pr.patch
+++ b/debian/patches/0005-libtrivfs-lock-less-reference-counting-for-trivfs_pr.patch
@@ -1,34 +1,29 @@
-From af1a321ffb5df24b3a5fa866ab2aa9c5b03f358c Mon Sep 17 00:00:00 2001
+From 7eea4685744efdc62f843f88b3abfad4ccd9f699 Mon Sep 17 00:00:00 2001
From: Justus Winter <4winter@informatik.uni-hamburg.de>
Date: Tue, 6 May 2014 19:07:13 +0200
-Subject: [PATCH 5/5] libtrivfs: lock-less reference counting for trivfs_protid
- objects
+Subject: [PATCH 5/5] libtrivfs: lock-less reference counting for
+ trivfs_peropen objects
* libtrivfs/trivfs.h (struct trivfs_protid): Use refcount_t for field
refcnt.
(struct trivfs_control): Remove unused field lock.
-* libtrivfs/open.c (trivfs_open): Initialize refcnt.
+* libtrivfs/cntl-create.c (trivfs_create_control): Drop the mutex
+initialization.
* libtrivfs/io-reauthenticate.c (trivfs_S_io_reauthenticate): Adjust
accordingly.
* libtrivfs/io-restrict-auth.c (trivfs_S_io_restrict_auth): Likewise.
+* libtrivfs/open.c (trivfs_open): Initialize refcnt.
* libtrivfs/protid-clean.c (trivfs_clean_protid): Likewise.
* libtrivfs/protid-dup.c (trivfs_protid_dup): Likewise.
-* libtrivfs/cntl-create.c (trivfs_create_control): Drop the mutex
-initialization.
-* libtrivfs/peropen-make.c (trivfs_make_peropen): Initialize refcnt.
-* libtrivfs/peropen-rele.c (trivfs_release_peropen): Adjust accordingly.
-* libtrivfs/protid-make.c (trivfs_start_protid): Likewise. Also, the
-node must no longer be locked, adjust comment accordingly.
-(trivfs_create_protid): Likewise.
---
libtrivfs/cntl-create.c | 1 -
libtrivfs/io-reauthenticate.c | 5 +----
libtrivfs/io-restrict-auth.c | 4 +---
libtrivfs/open.c | 2 +-
- libtrivfs/protid-clean.c | 25 ++++++++++++++-----------
+ libtrivfs/protid-clean.c | 26 +++++++++++++++-----------
libtrivfs/protid-dup.c | 5 +----
libtrivfs/trivfs.h | 4 ++--
- 7 files changed, 20 insertions(+), 26 deletions(-)
+ 7 files changed, 21 insertions(+), 26 deletions(-)
diff --git a/libtrivfs/cntl-create.c b/libtrivfs/cntl-create.c
index 910daf3..eb9a834 100644
@@ -89,10 +84,10 @@ index f64d2ff..97e70a1 100644
po->openmodes = flags;
po->hook = 0;
diff --git a/libtrivfs/protid-clean.c b/libtrivfs/protid-clean.c
-index f98da6a..815e731 100644
+index f98da6a..cce736d 100644
--- a/libtrivfs/protid-clean.c
+++ b/libtrivfs/protid-clean.c
-@@ -31,19 +31,22 @@ trivfs_clean_protid (void *arg)
+@@ -31,19 +31,23 @@ trivfs_clean_protid (void *arg)
(*trivfs_protid_destroy_hook) (cred);
/* If we hold the only reference to the peropen, try to get rid of it. */
@@ -103,8 +98,9 @@ index f98da6a..815e731 100644
- pthread_mutex_unlock (&cntl->lock);
- (*trivfs_peropen_destroy_hook) (cred->po);
- pthread_mutex_lock (&cntl->lock);
-+ if (trivfs_protid_destroy_hook)
++ if (trivfs_peropen_destroy_hook)
+ {
++ /* Reaquire a reference while we call the hook. */
+ refcount_ref (&cred->po->refcnt);
+ (*trivfs_peropen_destroy_hook) (cred->po);
+ if (refcount_deref (&cred->po->refcnt) == 0)