aboutsummaryrefslogtreecommitdiff
path: root/netfs.c
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-19 07:48:30 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:18:32 +0200
commitc6c770c33eb0f23e7e8e04976c711653cdf1a41d (patch)
treeff22cd9494fe9fb50f8d7b514d9a0f4102dd7db3 /netfs.c
parent4ac169deaa1eb4c8df4a49fc940700971fa5863a (diff)
downloadhurd-c6c770c33eb0f23e7e8e04976c711653cdf1a41d.tar.gz
hurd-c6c770c33eb0f23e7e8e04976c711653cdf1a41d.tar.bz2
hurd-c6c770c33eb0f23e7e8e04976c711653cdf1a41d.zip
Implement lookup for . and ..
* procfs.c (procfs_lookup): Keep track of the parent directory, implement the lookup of the dot-directories. (procfs_cleanup): Release the reference to the parent node, if applicable. * procfs.h: Add a comment about the parent reference. * netfs.c (netfs_attempt_lookup): Lock the looked up node after the directory has been unlocked, in case they are the same.
Diffstat (limited to 'netfs.c')
-rw-r--r--netfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/netfs.c b/netfs.c
index 58665085..6b105f91 100644
--- a/netfs.c
+++ b/netfs.c
@@ -151,10 +151,11 @@ error_t netfs_attempt_lookup (struct iouser *user, struct node *dir,
error_t err;
err = procfs_lookup (dir, name, np);
+ mutex_unlock (&dir->lock);
+
if (! err)
mutex_lock (&(*np)->lock);
- mutex_unlock (&dir->lock);
return err;
}