From 4abdd4dccce11f8a35e546140aa1ceaa7a498b30 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 4 Apr 1996 21:39:51 +0000 Subject: (diskfs_cached_lookup): Intialize NP->cache_id *after* NP exists. --- ufs/inode.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ufs') 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) -- cgit v1.2.3