[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[hurd] 78/98: trans/fakeroot: drop else
From: |
Samuel Thibault |
Subject: |
[hurd] 78/98: trans/fakeroot: drop else |
Date: |
Tue, 14 Jan 2014 02:00:04 +0000 |
This is an automated email from the git hooks/post-receive script.
sthibault pushed a commit to branch upstream
in repository hurd.
commit 4a6a4664f655e785e234e575f024f4674155e274
Author: Justus Winter <address@hidden>
Date: Tue Dec 10 17:01:02 2013 +0100
trans/fakeroot: drop else
* trans/fakeroot.c (netfs_S_dir_lookup): Drop else.
---
trans/fakeroot.c | 76 +++++++++++++++++++++++++++-----------------------------
1 file changed, 37 insertions(+), 39 deletions(-)
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 6882618..f278db1 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -329,54 +329,52 @@ netfs_S_dir_lookup (struct protid *diruser,
mach_port_deallocate (mach_task_self (), file);
return err;
}
+
+ mach_port_deallocate (mach_task_self (), fsidport);
+ if (fsidport == netfs_fsys_identity)
+ {
+ /* Talking to ourselves! We just looked up one of our
+ own nodes. Find the node and return it. */
+ assert (! "reached");
+ }
else
{
- mach_port_deallocate (mach_task_self (), fsidport);
- if (fsidport == netfs_fsys_identity)
+ pthread_mutex_lock (&idport_ihash_lock);
+ pthread_mutex_lock (&dnp->lock);
+ struct netnode *nn = hurd_ihash_find (&idport_ihash, idport);
+ if (nn != NULL)
{
- /* Talking to ourselves! We just looked up one of our
- own nodes. Find the node and return it. */
- assert (! "reached");
- }
- else
- {
- pthread_mutex_lock (&idport_ihash_lock);
- pthread_mutex_lock (&dnp->lock);
- struct netnode *nn = hurd_ihash_find (&idport_ihash, idport);
- if (nn != NULL)
+ assert (nn->np->nn == nn);
+ np = nn->np;
+ /* We already know about this node. */
+ mach_port_deallocate (mach_task_self (), idport);
+
+ if (np == dnp)
{
- assert (nn->np->nn == nn);
- np = nn->np;
- /* We already know about this node. */
- mach_port_deallocate (mach_task_self (), idport);
-
- if (np == dnp)
- {
- /* dnp is already locked. */
- }
- else
- {
- pthread_mutex_lock (&np->lock);
- pthread_mutex_unlock (&dnp->lock);
- }
-
- /* If the looked-up file carries a fake reference, we
- use that and clear the FAKE_REFERENCE flag. */
- if (np->nn->faked & FAKE_REFERENCE)
- np->nn->faked &= ~FAKE_REFERENCE;
- else
- netfs_nref (np);
-
- err = check_openmodes (np->nn, (flags & (O_RDWR|O_EXEC)), file);
- pthread_mutex_unlock (&idport_ihash_lock);
+ /* dnp is already locked. */
}
else
{
- err = new_node (file, idport, 1, flags, &np);
+ pthread_mutex_lock (&np->lock);
pthread_mutex_unlock (&dnp->lock);
- if (!err)
- err = netfs_validate_stat (np, diruser->user);
}
+
+ /* If the looked-up file carries a fake reference, we
+ use that and clear the FAKE_REFERENCE flag. */
+ if (np->nn->faked & FAKE_REFERENCE)
+ np->nn->faked &= ~FAKE_REFERENCE;
+ else
+ netfs_nref (np);
+
+ err = check_openmodes (np->nn, (flags & (O_RDWR|O_EXEC)), file);
+ pthread_mutex_unlock (&idport_ihash_lock);
+ }
+ else
+ {
+ err = new_node (file, idport, 1, flags, &np);
+ pthread_mutex_unlock (&dnp->lock);
+ if (!err)
+ err = netfs_validate_stat (np, diruser->user);
}
}
if (err)
--
Alioth's /usr/local/bin/git-commit-notice on
/srv/git.debian.org/git/pkg-hurd/hurd.git
- [hurd] 06/98: proc: fix the declaraton of genpid, (continued)
- [hurd] 06/98: proc: fix the declaraton of genpid, Samuel Thibault, 2014/01/13
- [hurd] 71/98: trans: fix locking in fakeroot's netfs_S_dir_lookup, Samuel Thibault, 2014/01/13
- [hurd] 70/98: trans: fix reference counting and destruction of fake nodes, Samuel Thibault, 2014/01/13
- [hurd] 77/98: trans/fakeroot: fix ownership of newly created files, Samuel Thibault, 2014/01/13
- [hurd] 64/98: libihash: remove dead code, Samuel Thibault, 2014/01/13
- [hurd] 74/98: trans: unlock nodes with faked attributes in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 75/98: console-client: remove spurious pthread_spin_unlocks, Samuel Thibault, 2014/01/13
- [hurd] 62/98: trans: make the fakeroot environment more transparent, Samuel Thibault, 2014/01/13
- [hurd] 14/98: proc: turn count_up and store_pid into normal functions, Samuel Thibault, 2014/01/13
- [hurd] 67/98: trans: handle invalid responses to dir_lookup requests in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 78/98: trans/fakeroot: drop else,
Samuel Thibault <=
- [hurd] 13/98: term: fix error handling in hurdio_mdmctl, Samuel Thibault, 2014/01/13
- [hurd] 08/98: proc: fix error handling in S_proc_exception_raise, Samuel Thibault, 2014/01/13
- [hurd] 07/98: proc: fix a use-after-free error, Samuel Thibault, 2014/01/13
- [hurd] 18/98: libdiskfs: remove dead assignment, Samuel Thibault, 2014/01/13
- [hurd] 60/98: trans: fix the creation of files in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 69/98: trans: return nodes locked when creating fake nodes in fakeroot, Samuel Thibault, 2014/01/13
- [hurd] 20/98: ext2fs: fix error handling, Samuel Thibault, 2014/01/13
- [hurd] 21/98: libshouldbeinlibc: fix dead assignment, Samuel Thibault, 2014/01/13
- [hurd] 93/98: trans/mtab: make the translator multithreaded, Samuel Thibault, 2014/01/13
- [hurd] 05/98: proc: remove declaration of nested functions from proc.h, Samuel Thibault, 2014/01/13