summaryrefslogtreecommitdiff
path: root/tmpfs/dir.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-02-26 04:14:01 +0000
committerRoland McGrath <roland@gnu.org>2001-02-26 04:14:01 +0000
commitec5ad262100068c11b985dc9257fa9b8b8e34da7 (patch)
tree339735bcb09a312fe13a1a024681bcc92b0fe88f /tmpfs/dir.c
parent843308fa3521ae0cb319442ac03d951c0a7d1230 (diff)
2001-02-25 Roland McGrath <roland@frob.com>
* dir.c (diskfs_lookup_hard): Look up .. disknode's in-core node.
Diffstat (limited to 'tmpfs/dir.c')
-rw-r--r--tmpfs/dir.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/tmpfs/dir.c b/tmpfs/dir.c
index 92fa8e32..ebaf4b43 100644
--- a/tmpfs/dir.c
+++ b/tmpfs/dir.c
@@ -1,5 +1,5 @@
/* Directories for tmpfs.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001 Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -150,22 +150,30 @@ diskfs_lookup_hard (struct node *dp,
}
if (namelen == 2 && name[0] == '.' && name[1] == '.')
{
- struct disknode *ddnp = dp->dn->u.dir.dotdot;
+ struct disknode *dddn = dp->dn->u.dir.dotdot;
+ struct node *ddnp = 0;
+ error_t err;
+
assert (np != 0);
- if (ddnp == 0) /* root directory */
+ if (dddn == 0) /* root directory */
return EAGAIN;
+
+ err = diskfs_cached_lookup ((int) dddn, &ddnp);
switch (type)
{
case LOOKUP|SPEC_DOTDOT:
diskfs_nput (dp);
default:
- diskfs_nref (ddnp);
- mutex_lock (&ddnp->lock);
+ if (!err)
+ {
+ diskfs_nref (ddnp);
+ mutex_lock (&ddnp->lock);
+ }
case REMOVE|SPEC_DOTDOT:
case RENAME|SPEC_DOTDOT:
*np = ddnp;
}
- return 0;
+ return err;
}
for (d = *(prevp = &dp->dn->u.dir.entries); d != 0;