summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2002-02-17 20:40:29 +0000
committerphk <phk@FreeBSD.org>2002-02-17 20:40:29 +0000
commit4a29a670dbc0db27f2aa63b11d1a606f0a7ce359 (patch)
tree094ad01ece8d91dd3d6a18a135313132bb386f6d
parent3b5e344ad2f73a32d8ee9a6abc3c64ce85df911a (diff)
downloadFreeBSD-src-4a29a670dbc0db27f2aa63b11d1a606f0a7ce359.zip
FreeBSD-src-4a29a670dbc0db27f2aa63b11d1a606f0a7ce359.tar.gz
Remove cache_purgeleafdirs(), it has been #if 0 for quite some time.
-rw-r--r--sys/kern/vfs_cache.c60
1 files changed, 0 insertions, 60 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index cccb69d..fa6c4aa 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -527,66 +527,6 @@ cache_purgevfs(mp)
}
}
-#if 0
-
-/*
- * Flush all dirctory entries with no child directories held in
- * the cache.
- *
- * Since we need to check it anyway, we will flush all the invalid
- * entries at the same time.
- */
-void
-cache_purgeleafdirs(ndir)
- int ndir;
-{
- struct nchashhead *ncpp;
- struct namecache *ncp, *nnp, *ncpc, *nnpc;
- struct vnode *dvp;
-
- /* Scan hash tables for applicable entries */
- for (ncpp = &nchashtbl[nchash]; ncpp >= nchashtbl && ndir > 0; ncpp--) {
- for (ncp = LIST_FIRST(ncpp); ncp != 0 && ndir > 0; ncp = nnp) {
- nnp = LIST_NEXT(ncp, nc_hash);
- if (ncp->nc_dvp != 0) {
- /*
- * Skip over if nc_dvp of this cache holds
- * a child directory, or the hold count of
- * nc_dvp is greater than 1 (in which case
- * nc_dvp is likely to be the working
- * directory of a process).
- */
- if (ncp->nc_dvp->v_holdcnt > 1)
- continue;
- for (ncpc = LIST_FIRST(&ncp->nc_dvp->v_cache_src);
- ncpc != 0; ncpc = nnpc) {
- nnpc = LIST_NEXT(ncpc, nc_src);
- if (ncpc->nc_vp != 0 && ncpc->nc_vp->v_type == VDIR)
- break;
- }
- if (ncpc == 0) {
- /*
- * Zap all of this directory's children,
- * held in ncp->nc_dvp->v_cache_src.
- */
- dvp = ncp->nc_dvp;
- while (!LIST_EMPTY(&dvp->v_cache_src))
- cache_zap(LIST_FIRST(&dvp->v_cache_src));
-
- ndir--;
-
- /* Restart in case where nnp is reclaimed. */
- nnp = LIST_FIRST(ncpp);
- continue;
- }
- }
- }
- }
- numcachepl++;
-}
-
-#endif
-
/*
* Perform canonical checks and cache lookup and pass on to filesystem
* through the vop_cachedlookup only if needed.
OpenPOWER on IntegriCloud