* Remove all negative entries for a particular directory vnode. */
| 2712 | * Remove all negative entries for a particular directory vnode. |
| 2713 | */ |
| 2714 | void |
| 2715 | cache_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. |
no test coverage detected