[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 14/14: Avoid superfluous locking of node
From: |
Samuel Thibault |
Subject: |
[hurd] 14/14: Avoid superfluous locking of node |
Date: |
Sun, 22 May 2016 01:15:22 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 04cfa521cd6f38d7cd735ead5b7978390664042e
Author: Justus Winter <address@hidden>
Date: Mon Apr 25 00:54:08 2016 +0200
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.
---
libdiskfs/io-restrict-auth.c | 2 --
libnetfs/io-restrict-auth.c | 3 ---
2 files changed, 5 deletions(-)
diff --git a/libdiskfs/io-restrict-auth.c b/libdiskfs/io-restrict-auth.c
index 80c0b20..1c2c999 100644
--- a/libdiskfs/io-restrict-auth.c
+++ b/libdiskfs/io-restrict-auth.c
@@ -40,7 +40,6 @@ diskfs_S_io_restrict_auth (struct protid *cred,
if (err)
return err;
- pthread_mutex_lock (&cred->po->np->lock);
refcount_ref (&cred->po->refcnt);
err = diskfs_create_protid (cred->po, user, &newpi);
if (! err)
@@ -51,7 +50,6 @@ diskfs_S_io_restrict_auth (struct protid *cred,
}
else
refcount_deref (&cred->po->refcnt);
- pthread_mutex_unlock (&cred->po->np->lock);
iohelp_free_iouser (user);
return err;
diff --git a/libnetfs/io-restrict-auth.c b/libnetfs/io-restrict-auth.c
index 79b7d09..89df671 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;
}
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] branch upstream updated (b90164e -> 04cfa52), Samuel Thibault, 2016/05/21
- [hurd] 01/14: Fix privileged operations on trivfs-translated nodes, Samuel Thibault, 2016/05/21
- [hurd] 04/14: startup: fix blunder, Samuel Thibault, 2016/05/21
- [hurd] 06/14: GNU Hurd 0.8, Samuel Thibault, 2016/05/21
- [hurd] 05/14: Complete changes to use -L instead of -Wl, -rpath-link, Samuel Thibault, 2016/05/21
- [hurd] 07/14: mach-defpager: fix panic invocation, Samuel Thibault, 2016/05/21
- [hurd] 02/14: libihash: fix corner case, Samuel Thibault, 2016/05/21
- [hurd] 12/14: libnetfs: treat disconnected shadow roots as virtual roots, Samuel Thibault, 2016/05/21
- [hurd] 14/14: Avoid superfluous locking of node,
Samuel Thibault <=
- [hurd] 10/14: libdiskfs: cosmetic changes, Samuel Thibault, 2016/05/21
- [hurd] 09/14: libnetfs: rename 'diruser' to 'dircred', Samuel Thibault, 2016/05/21
- [hurd] 08/14: libnetfs: rename 'error' to 'err', Samuel Thibault, 2016/05/21
- [hurd] 03/14: libihash: enable fast insertions replacing tombstones, Samuel Thibault, 2016/05/21
- [hurd] 11/14: Unify the short-circuit translator logic, Samuel Thibault, 2016/05/21
- [hurd] 13/14: utils/settrans: implement active translator stacking, Samuel Thibault, 2016/05/21