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

Function cache_enter_dotdot_prep

freebsd/kern/vfs_cache.c:2249–2275  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2247}
2248
2249static void __noinline
2250cache_enter_dotdot_prep(struct vnode *dvp, struct vnode *vp,
2251 struct componentname *cnp)
2252{
2253 struct celockstate cel;
2254 struct namecache *ncp;
2255 uint32_t hash;
2256 int len;
2257
2258 if (atomic_load_ptr(&dvp->v_cache_dd) == NULL)
2259 return;
2260 len = cnp->cn_namelen;
2261 cache_celockstate_init(&cel);
2262 hash = cache_get_hash(cnp->cn_nameptr, len, dvp);
2263 cache_enter_lock_dd(&cel, dvp, vp, hash);
2264 ncp = dvp->v_cache_dd;
2265 if (ncp != NULL && (ncp->nc_flag & NCF_ISDOTDOT)) {
2266 KASSERT(ncp->nc_dvp == dvp, ("wrong isdotdot parent"));
2267 cache_zap_locked(ncp);
2268 } else {
2269 ncp = NULL;
2270 }
2271 atomic_store_ptr(&dvp->v_cache_dd, NULL);
2272 cache_enter_unlock(&cel);
2273 if (ncp != NULL)
2274 cache_free(ncp);
2275}
2276
2277/*
2278 * Add an entry to the cache.

Callers 1

cache_enter_timeFunction · 0.85

Calls 6

cache_celockstate_initFunction · 0.85
cache_get_hashFunction · 0.85
cache_enter_lock_ddFunction · 0.85
cache_zap_lockedFunction · 0.85
cache_enter_unlockFunction · 0.85
cache_freeFunction · 0.70

Tested by

no test coverage detected