* Entry points for modifying VOP operations. */
| 2738 | * Entry points for modifying VOP operations. |
| 2739 | */ |
| 2740 | void |
| 2741 | cache_vop_rename(struct vnode *fdvp, struct vnode *fvp, struct vnode *tdvp, |
| 2742 | struct vnode *tvp, struct componentname *fcnp, struct componentname *tcnp) |
| 2743 | { |
| 2744 | |
| 2745 | ASSERT_VOP_IN_SEQC(fdvp); |
| 2746 | ASSERT_VOP_IN_SEQC(fvp); |
| 2747 | ASSERT_VOP_IN_SEQC(tdvp); |
| 2748 | if (tvp != NULL) |
| 2749 | ASSERT_VOP_IN_SEQC(tvp); |
| 2750 | |
| 2751 | cache_purge(fvp); |
| 2752 | if (tvp != NULL) { |
| 2753 | cache_purge(tvp); |
| 2754 | KASSERT(!cache_remove_cnp(tdvp, tcnp), |
| 2755 | ("%s: lingering negative entry", __func__)); |
| 2756 | } else { |
| 2757 | cache_remove_cnp(tdvp, tcnp); |
| 2758 | } |
| 2759 | |
| 2760 | /* |
| 2761 | * TODO |
| 2762 | * |
| 2763 | * Historically renaming was always purging all revelang entries, |
| 2764 | * but that's quite wasteful. In particular turns out that in many cases |
| 2765 | * the target file is immediately accessed after rename, inducing a cache |
| 2766 | * miss. |
| 2767 | * |
| 2768 | * Recode this to reduce relocking and reuse the existing entry (if any) |
| 2769 | * instead of just removing it above and allocating a new one here. |
| 2770 | */ |
| 2771 | if (cache_rename_add) { |
| 2772 | cache_enter(tdvp, fvp, tcnp); |
| 2773 | } |
| 2774 | } |
| 2775 | |
| 2776 | void |
| 2777 | cache_vop_rmdir(struct vnode *dvp, struct vnode *vp) |
nothing calls this directly
no test coverage detected