summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-04-04 21:39:51 +0000
committerMiles Bader <miles@gnu.org>1996-04-04 21:39:51 +0000
commit0bb6f48ecc0aa8a8136760706fd7bca235e10f2d (patch)
treecd99ef68367e6f40be05321d1a66be77638025db
parentab100791b595a0f7750362f1dd9c7eb62443fe88 (diff)
(diskfs_cached_lookup): Intialize NP->cache_id *after* NP exists.
-rw-r--r--ufs/inode.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ufs/inode.c b/ufs/inode.c
index ef0d9241..e4b26f81 100644
--- a/ufs/inode.c
+++ b/ufs/inode.c
@@ -66,7 +66,7 @@ diskfs_cached_lookup (int inum, struct node **npp)
dn = malloc (sizeof (struct disknode));
- np->cache_id = dn->number = inum;
+ dn->number = inum;
dn->dirents = 0;
rwlock_init (&dn->allocptrlock);
@@ -74,6 +74,8 @@ diskfs_cached_lookup (int inum, struct node **npp)
dn->fileinfo = 0;
np = diskfs_make_node (dn);
+ np->cache_id = inum;
+
mutex_lock (&np->lock);
dn->hnext = nodehash[INOHASH(inum)];
if (dn->hnext)