* move this slot to end of LRU chain, if not already there
* If the above vget() failed or either of LOCKPARENT or * ISLASTCN is set, unlock the directory vnode.
cache_lookup(dvp, vpp, cnp)	struct vnode *dvp;	struct vnode **vpp;	struct componentname *cnp;{	register struct namecache *ncp;	register struct nchashhead *ncpp;	if (!doingcache) {		cnp->cn_flags &= ~MAKEENTRY;		return (0);	}	if (cnp->cn_namelen > NCHNAMLEN) {		nchstats.ncs_long++;		cnp->cn_flags &= ~MAKEENTRY;		return (0);	}	ncpp = &nchashtbl[	    hash32_buf(&dvp->v_id, sizeof(dvp->v_id), cnp->cn_hash) & nchash];	for (ncp = ncpp->lh_first; ncp != 0; ncp = ncp->nc_hash.le_next) {		if (ncp->nc_dvp == dvp &&		    ncp->nc_dvpid == dvp->v_id &&		    ncp->nc_nlen == cnp->cn_namelen &&		    !bcmp(ncp->nc_name, cnp->cn_nameptr, (u_int)ncp->nc_nlen))			break;	}	if (ncp == 0) {		nchstats.ncs_miss++;		return (0);	}	if ((cnp->cn_flags & MAKEENTRY) == 0) {		nchstats.ncs_badhits++;	} else if (ncp->nc_vp == NULL) {		/*		 * Restore the ISWHITEOUT flag saved earlier.		 */		cnp->cn_flags |= ncp->nc_vpid;		if (cnp->cn_nameiop != CREATE) {			nchstats.ncs_neghits++;			/*			 * Move this slot to end of LRU chain,			 * if not already there.			 */			if (ncp->nc_lru.tqe_next != 0) {				TAILQ_REMOVE(&nclruhead, ncp, nc_lru);				TAILQ_INSERT_TAIL(&nclruhead, ncp, nc_lru);			}			return (ENOENT);		}	} else if (ncp->nc_vpid != ncp->nc_vp->v_id) {		nchstats.ncs_falsehits++;	} else {		nchstats.ncs_goodhits++;		/*		 * move this slot to end of LRU chain, if not already there		 */		if (ncp->nc_lru.tqe_next != 0) {			TAILQ_REMOVE(&nclruhead, ncp, nc_lru);			TAILQ_INSERT_TAIL(&nclruhead, ncp, nc_lru);		}		*vpp = ncp->nc_vp;		return (-1);	}	/*	 * Last component and we are renaming or deleting,	 * the cache entry is invalid, or otherwise don't	 * want cache entry to exist.	 */	TAILQ_REMOVE(&nclruhead, ncp, nc_lru);	LIST_REMOVE(ncp, nc_hash);	ncp->nc_hash.le_prev = 0;	TAILQ_INSERT_HEAD(&nclruhead, ncp, nc_lru);	return (0);}