* cache_zap_locked(): * * Removes a namecache entry from cache, whether it contains an actual * pointer to a vnode or if it is just a negative cache entry. */
| 1440 | * pointer to a vnode or if it is just a negative cache entry. |
| 1441 | */ |
| 1442 | static void |
| 1443 | cache_zap_locked(struct namecache *ncp) |
| 1444 | { |
| 1445 | struct nchashhead *ncpp; |
| 1446 | struct vnode *dvp, *vp; |
| 1447 | |
| 1448 | dvp = ncp->nc_dvp; |
| 1449 | vp = ncp->nc_vp; |
| 1450 | |
| 1451 | if (!(ncp->nc_flag & NCF_NEGATIVE)) |
| 1452 | cache_assert_vnode_locked(vp); |
| 1453 | cache_assert_vnode_locked(dvp); |
| 1454 | cache_assert_bucket_locked(ncp); |
| 1455 | |
| 1456 | cache_ncp_invalidate(ncp); |
| 1457 | |
| 1458 | ncpp = NCP2BUCKET(ncp); |
| 1459 | CK_SLIST_REMOVE(ncpp, ncp, namecache, nc_hash); |
| 1460 | if (!(ncp->nc_flag & NCF_NEGATIVE)) { |
| 1461 | SDT_PROBE3(vfs, namecache, zap, done, dvp, ncp->nc_name, vp); |
| 1462 | TAILQ_REMOVE(&vp->v_cache_dst, ncp, nc_dst); |
| 1463 | if (ncp == vp->v_cache_dd) { |
| 1464 | atomic_store_ptr(&vp->v_cache_dd, NULL); |
| 1465 | } |
| 1466 | } else { |
| 1467 | SDT_PROBE2(vfs, namecache, zap_negative, done, dvp, ncp->nc_name); |
| 1468 | cache_neg_remove(ncp); |
| 1469 | } |
| 1470 | if (ncp->nc_flag & NCF_ISDOTDOT) { |
| 1471 | if (ncp == dvp->v_cache_dd) { |
| 1472 | atomic_store_ptr(&dvp->v_cache_dd, NULL); |
| 1473 | } |
| 1474 | } else { |
| 1475 | LIST_REMOVE(ncp, nc_src); |
| 1476 | if (LIST_EMPTY(&dvp->v_cache_src)) { |
| 1477 | ncp->nc_flag |= NCF_DVDROP; |
| 1478 | } |
| 1479 | } |
| 1480 | } |
| 1481 | |
| 1482 | static void |
| 1483 | cache_zap_negative_locked_vnode_kl(struct namecache *ncp, struct vnode *vp) |
no test coverage detected