From 0d899d01c1fd92303dcc6f2a0faffd0c7e864d2a Mon Sep 17 00:00:00 2001 From: pjd Date: Fri, 25 May 2007 22:16:17 +0000 Subject: [PATCH] The cache_leaf_test() function seems to be unused, so remove it. --- sys/kern/vfs_cache.c | 31 ------------------------------- sys/sys/vnode.h | 1 - 2 files changed, 32 deletions(-) diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index f6391556fe8b..9b96b9443a57 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -292,37 +292,6 @@ cache_zap(ncp) vdrop(vp); } -/* - * cache_leaf_test() - * - * Test whether this (directory) vnode's namei cache entry contains - * subdirectories or not. Used to determine whether the directory is - * a leaf in the namei cache or not. Note: the directory may still - * contain files in the namei cache. - * - * Returns 0 if the directory is a leaf, -1 if it isn't. - */ -int -cache_leaf_test(struct vnode *vp) -{ - struct namecache *ncpc; - int leaf; - - leaf = 0; - CACHE_LOCK(); - for (ncpc = LIST_FIRST(&vp->v_cache_src); - ncpc != NULL; - ncpc = LIST_NEXT(ncpc, nc_src) - ) { - if (ncpc->nc_vp != NULL && ncpc->nc_vp->v_type == VDIR) { - leaf = -1; - break; - } - } - CACHE_UNLOCK(); - return (leaf); -} - /* * Lookup an entry in the cache * diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h index 1f1faa0278f7..4b20140be234 100644 --- a/sys/sys/vnode.h +++ b/sys/sys/vnode.h @@ -565,7 +565,6 @@ int cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp); void cache_purge(struct vnode *vp); void cache_purgevfs(struct mount *mp); -int cache_leaf_test(struct vnode *vp); int change_dir(struct vnode *vp, struct thread *td); int change_root(struct vnode *vp, struct thread *td); void cvtstat(struct stat *st, struct ostat *ost);