From 04cfa521cd6f38d7cd735ead5b7978390664042e Mon Sep 17 00:00:00 2001
From: Justus Winter <justus@gnupg.org>
Date: Mon, 25 Apr 2016 00:54:08 +0200
Subject: Avoid superfluous locking of node

* libdiskfs/io-restrict-auth.c (diskfs_S_io_restrict_auth): Do not
lock the associated node.  No operation here needs synchronization.
* libnetfs/io-restrict-auth.c (netfs_S_io_restrict_auth): Likewise.
---
 libnetfs/io-restrict-auth.c | 3 ---
 1 file changed, 3 deletions(-)

(limited to 'libnetfs')

diff --git a/libnetfs/io-restrict-auth.c b/libnetfs/io-restrict-auth.c
index 79b7d095..89df6716 100644
--- a/libnetfs/io-restrict-auth.c
+++ b/libnetfs/io-restrict-auth.c
@@ -42,19 +42,16 @@ netfs_S_io_restrict_auth (struct protid *user,
   if (err)
     return err;
 
-  pthread_mutex_lock (&user->po->np->lock);
   refcount_ref (&user->po->refcnt);
   newpi = netfs_make_protid (user->po, new_user);
   if (newpi)
     {
       *newport = ports_get_right (newpi);
-      pthread_mutex_unlock (&user->po->np->lock);
       *newporttype = MACH_MSG_TYPE_MAKE_SEND;
     }
   else
     {
       refcount_deref (&user->po->refcnt);
-      pthread_mutex_unlock (&user->po->np->lock);
       iohelp_free_iouser (new_user);
       err = ENOMEM;
     }
-- 
cgit v1.2.3