vrecycle removed nfs vnodes.
not perfect, but enough for most cases.
This commit is contained in:
parent
cc104d0635
commit
33164bffc6
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: nfs_node.c,v 1.68 2003/06/29 22:32:15 fvdl Exp $ */
|
||||
/* $NetBSD: nfs_node.c,v 1.69 2003/07/30 12:25:39 yamt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
|
@ -39,7 +39,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_node.c,v 1.68 2003/06/29 22:32:15 fvdl Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_node.c,v 1.69 2003/07/30 12:25:39 yamt Exp $");
|
||||
|
||||
#include "opt_nfs.h"
|
||||
|
||||
|
@ -232,6 +232,7 @@ nfs_inactive(v)
|
|||
struct proc *p = ap->a_p;
|
||||
struct vnode *vp = ap->a_vp;
|
||||
struct nfsmount *nmp = VFSTONFS(vp->v_mount);
|
||||
boolean_t removed;
|
||||
|
||||
np = VTONFS(vp);
|
||||
if (prtactive && vp->v_usecount != 0)
|
||||
|
@ -243,6 +244,7 @@ nfs_inactive(v)
|
|||
sp = NULL;
|
||||
if (sp != NULL)
|
||||
nfs_vinvalbuf(vp, 0, sp->s_cred, p, 1);
|
||||
removed = (np->n_flag & NREMOVED) != 0;
|
||||
np->n_flag &= (NMODIFIED | NFLUSHINPROG | NFLUSHWANT | NQNFSEVICTED |
|
||||
NQNFSNONCACHE | NQNFSWRITE);
|
||||
VOP_UNLOCK(vp, 0);
|
||||
|
@ -266,6 +268,9 @@ nfs_inactive(v)
|
|||
if (vp->v_type == VDIR && np->n_dircache)
|
||||
nfs_invaldircache(vp, 1);
|
||||
|
||||
if (removed)
|
||||
vrecycle(vp, NULL, p);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: nfs_vnops.c,v 1.175 2003/06/29 22:32:20 fvdl Exp $ */
|
||||
/* $NetBSD: nfs_vnops.c,v 1.176 2003/07/30 12:25:39 yamt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
|
@ -43,7 +43,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.175 2003/06/29 22:32:20 fvdl Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: nfs_vnops.c,v 1.176 2003/07/30 12:25:39 yamt Exp $");
|
||||
|
||||
#include "opt_nfs.h"
|
||||
#include "opt_uvmhist.h"
|
||||
|
@ -1744,6 +1744,10 @@ nfs_remove(v)
|
|||
} else if (!np->n_sillyrename)
|
||||
error = nfs_sillyrename(dvp, vp, cnp);
|
||||
PNBUF_PUT(cnp->cn_pnbuf);
|
||||
if (!error && nfs_getattrcache(vp, &vattr) == 0 &&
|
||||
vattr.va_nlink == 1) {
|
||||
np->n_flag |= NREMOVED;
|
||||
}
|
||||
np->n_attrstamp = 0;
|
||||
VN_KNOTE(vp, NOTE_DELETE);
|
||||
VN_KNOTE(dvp, NOTE_WRITE);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: nfsnode.h,v 1.40 2003/05/07 16:18:54 yamt Exp $ */
|
||||
/* $NetBSD: nfsnode.h,v 1.41 2003/07/30 12:25:39 yamt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
|
@ -175,6 +175,7 @@ LIST_HEAD(nfsnodehashhead, nfsnode);
|
|||
#define NUPD 0x0200 /* Special file updated */
|
||||
#define NCHG 0x0400 /* Special file times changed */
|
||||
#define NTRUNCDELAYED 0x1000 /* Should be truncated later */
|
||||
#define NREMOVED 0x2000 /* Has been removed */
|
||||
|
||||
/*
|
||||
* Convert between nfsnode pointers and vnode pointers
|
||||
|
|
Loading…
Reference in New Issue