summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
authorjeff <jeff@FreeBSD.org>2005-06-13 05:59:59 +0000
committerjeff <jeff@FreeBSD.org>2005-06-13 05:59:59 +0000
commit22b5cc07b0583b989f4440150b8b32a38bd232b7 (patch)
treea183d4341e6d53aabb56ce0b04cb8b65c33bdefd /sys/kern/vfs_cache.c
parent659954b65e92d874eb890a44f312d86797282983 (diff)
downloadFreeBSD-src-22b5cc07b0583b989f4440150b8b32a38bd232b7.zip
FreeBSD-src-22b5cc07b0583b989f4440150b8b32a38bd232b7.tar.gz
- Clear v_dd in cache_zap() instead of cache_purge() as cache_purge() may
not be called in all cases where we free the cnp. Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r--sys/kern/vfs_cache.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 0023487..88ecc35 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -281,6 +281,7 @@ cache_zap(ncp)
}
if (ncp->nc_vp) {
TAILQ_REMOVE(&ncp->nc_vp->v_cache_dst, ncp, nc_dst);
+ ncp->nc_vp->v_dd = NULL;
} else {
TAILQ_REMOVE(&ncneg, ncp, nc_dst);
numneg--;
@@ -577,22 +578,11 @@ void
cache_purge(vp)
struct vnode *vp;
{
- struct namecache *ncp;
CTR1(KTR_VFS, "cache_purge(%p)", vp);
CACHE_LOCK();
- while (!LIST_EMPTY(&vp->v_cache_src)) {
- struct vnode *cvp;
-
- ncp = LIST_FIRST(&vp->v_cache_src);
- /*
- * We must reset v_dd of any children so they don't
- * continue to point to us.
- */
- if ((cvp = ncp->nc_vp) && cvp->v_dd == vp)
- cvp->v_dd = NULL;
- cache_zap(ncp);
- }
+ while (!LIST_EMPTY(&vp->v_cache_src))
+ cache_zap(LIST_FIRST(&vp->v_cache_src));
while (!TAILQ_EMPTY(&vp->v_cache_dst))
cache_zap(TAILQ_FIRST(&vp->v_cache_dst));
vp->v_dd = NULL;
OpenPOWER on IntegriCloud