summaryrefslogtreecommitdiff
path: root/trans/fakeroot.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2013-12-10 17:01:02 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2013-12-10 18:04:39 +0100
commit4a6a4664f655e785e234e575f024f4674155e274 (patch)
tree1ed1146e3cc13eac18a501f7f7b7996b9acf4e7c /trans/fakeroot.c
parentcb42b5fa92329496f25f9479257bd03aeb346205 (diff)
trans/fakeroot: drop else
* trans/fakeroot.c (netfs_S_dir_lookup): Drop else.
Diffstat (limited to 'trans/fakeroot.c')
-rw-r--r--trans/fakeroot.c76
1 files changed, 37 insertions, 39 deletions
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index 68826182..f278db13 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)