summaryrefslogtreecommitdiff
path: root/nfs/cache.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-03-12 21:00:10 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-03-12 21:00:10 +0000
commit0d40f94d2234d4dd03195afc766e2b37ae80735a (patch)
treefbb186038470fb0f44a6fbed67a2c2202364768b /nfs/cache.c
parent43e4e49faf65790f8167998118e1391932d3a1a3 (diff)
Formerly cache.c.~7~
Diffstat (limited to 'nfs/cache.c')
-rw-r--r--nfs/cache.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/nfs/cache.c b/nfs/cache.c
index 75a8b250..7839e9e7 100644
--- a/nfs/cache.c
+++ b/nfs/cache.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Written by Michael I. Bushnell, p/BSG.
This file is part of the GNU Hurd.
@@ -39,7 +39,7 @@ hash (void *fhandle)
}
struct node *
-lookup_fhandle (void *fhandle)
+lookup_fhandle (void *fhandle, struct node *dir)
{
struct node *np;
struct netnode *nn;
@@ -60,6 +60,9 @@ lookup_fhandle (void *fhandle)
nn = malloc (sizeof (struct netnode));
bcopy (fhandle, nn->handle, NFS_FHSIZE);
nn->stat_updated = 0;
+ if (dir)
+ dir->references++;
+ nn->dir = dir;
np = netfs_make_node (nn);
mutex_lock (&np->lock);
@@ -76,6 +79,7 @@ lookup_fhandle (void *fhandle)
void
netfs_node_norefs (struct node *np)
{
+ struct node *dir;
if (np->nn->dead_dir)
{
struct node *dir;
@@ -101,10 +105,15 @@ netfs_node_norefs (struct node *np)
}
else
{
+ dir = np->nn->dir;
*np->nn->hprevp = np->nn->hnext;
if (np->nn->hnext)
np->nn->hnext->nn->hprevp = np->nn->hprevp;
free (np->nn);
free (np);
+
+ spin_unlock (&netfs_node_refcnt_lock);
+ netfs_nrele (dir);
+ spin_lock (&netfs_node_refcnt_lock);
}
}