FreeBSD/sys/kern/vfs_cache.c
/*
 * Invalidate all entries to a particular vnode.
 */
Invalidate all entries to a particular vnode.
Invalidate all entries to a particular vnode .
void
cache_purge(struct vnode *vp)
{
	CTR1(KTR_VFS, "cache_purge(%p)", vp);
	SDT_PROBE1(vfs, namecache, purge, done, vp);
	CACHE_WLOCK();
	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));
	if (vp->v_cache_dd != NULL) {
		KASSERT(vp->v_cache_dd->nc_flag & NCF_ISDOTDOT,
		   ("lost dotdot link"));
		cache_zap(vp->v_cache_dd);
	}
	KASSERT(vp->v_cache_dd == NULL, ("incomplete purge"));
	CACHE_WUNLOCK();
}
void cache_purge ( struct vnode * vp ) { CTR1 ( KTR_VFS , " " , vp ) ; SDT_PROBE1 ( vfs , namecache , purge , done , vp ) ; CACHE_WLOCK ( ) ; 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 ) ) ; if ( vp -> v_cache_dd != NULL ) { KASSERT ( vp -> v_cache_dd -> nc_flag & NCF_ISDOTDOT , ( " " ) ) ; cache_zap ( vp -> v_cache_dd ) ; } KASSERT ( vp -> v_cache_dd == NULL , ( " " ) ) ; CACHE_WUNLOCK ( ) ; }
Invalidate all entries to a particular vnode.
Invalidate all entries to a particular vnode .