MCPcopy Create free account
hub / github.com/F-Stack/f-stack / cache_purge_negative

Function cache_purge_negative

freebsd/kern/vfs_cache.c:2714–2735  ·  view source on GitHub ↗

* Remove all negative entries for a particular directory vnode. */

Source from the content-addressed store, hash-verified

2712 * Remove all negative entries for a particular directory vnode.
2713 */
2714void
2715cache_purge_negative(struct vnode *vp)
2716{
2717 struct cache_freebatch batch;
2718 struct namecache *ncp, *nnp;
2719 struct mtx *vlp;
2720
2721 SDT_PROBE1(vfs, namecache, purge_negative, done, vp);
2722 if (LIST_EMPTY(&vp->v_cache_src))
2723 return;
2724 TAILQ_INIT(&batch);
2725 vlp = VP2VNODELOCK(vp);
2726 mtx_lock(vlp);
2727 LIST_FOREACH_SAFE(ncp, &vp->v_cache_src, nc_src, nnp) {
2728 if (!(ncp->nc_flag & NCF_NEGATIVE))
2729 continue;
2730 cache_zap_negative_locked_vnode_kl(ncp, vp);
2731 TAILQ_INSERT_TAIL(&batch, ncp, nc_dst);
2732 }
2733 mtx_unlock(vlp);
2734 cache_free_batch(&batch);
2735}
2736
2737/*
2738 * Entry points for modifying VOP operations.

Callers 1

cache_vop_renameFunction · 0.85

Calls 5

VP2VNODELOCKFunction · 0.85
cache_free_batchFunction · 0.85
mtx_lockFunction · 0.70
mtx_unlockFunction · 0.70

Tested by

no test coverage detected