summaryrefslogtreecommitdiff
path: root/nfs
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-12-18 22:09:23 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-12-18 22:09:23 +0000
commit85d7a015ea0c440735f58a4859cf6de25b664af7 (patch)
tree0cfc959a56fb7ec1d6f2a08d803d8e0fa456439c /nfs
parent7c5e822d023bb8bb5db361bb3a304b45ded6594a (diff)
Formerly cache.c.~6~
Diffstat (limited to 'nfs')
-rw-r--r--nfs/cache.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/nfs/cache.c b/nfs/cache.c
index f72bba59..75a8b250 100644
--- a/nfs/cache.c
+++ b/nfs/cache.c
@@ -78,17 +78,24 @@ netfs_node_norefs (struct node *np)
{
if (np->nn->dead_dir)
{
+ struct node *dir;
+ char *name;
+
np->references++;
spin_unlock (&netfs_node_refcnt_lock);
-
- netfs_attempt_unlink ((struct netcred *)-1, np->nn->dead_dir,
- np->nn->dead_name);
- netfs_nrele (np->nn->dead_dir);
- free (np->nn->dead_name);
+
+ dir = np->nn->dead_dir;
+ name = np->nn->dead_name;
np->nn->dead_dir = 0;
np->nn->dead_name = 0;
netfs_nput (np);
+ mutex_lock (&dir->lock);
+ netfs_attempt_unlink ((struct netcred *)-1, dir, name);
+
+ netfs_nput (dir);
+ free (name);
+
/* Caller expects us to leave this locked... */
spin_lock (&netfs_node_refcnt_lock);
}