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

Function cache_enter_lock_dd

freebsd/kern/vfs_cache.c:2204–2239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2202}
2203
2204static void
2205cache_enter_lock_dd(struct celockstate *cel, struct vnode *dvp, struct vnode *vp,
2206 uint32_t hash)
2207{
2208 struct namecache *ncp;
2209 struct mtx *blps[2];
2210 u_char nc_flag;
2211
2212 blps[0] = HASH2BUCKETLOCK(hash);
2213 for (;;) {
2214 blps[1] = NULL;
2215 cache_lock_vnodes_cel(cel, dvp, vp);
2216 ncp = atomic_load_consume_ptr(&dvp->v_cache_dd);
2217 if (ncp == NULL)
2218 break;
2219 nc_flag = atomic_load_char(&ncp->nc_flag);
2220 if ((nc_flag & NCF_ISDOTDOT) == 0)
2221 break;
2222 MPASS(ncp->nc_dvp == dvp);
2223 blps[1] = NCP2BUCKETLOCK(ncp);
2224 if ((nc_flag & NCF_NEGATIVE) != 0)
2225 break;
2226 if (cache_lock_vnodes_cel_3(cel, ncp->nc_vp))
2227 break;
2228 if (ncp == dvp->v_cache_dd &&
2229 (ncp->nc_flag & NCF_ISDOTDOT) != 0 &&
2230 blps[1] == NCP2BUCKETLOCK(ncp) &&
2231 VP2VNODELOCK(ncp->nc_vp) == cel->vlp[2])
2232 break;
2233 cache_unlock_vnodes_cel(cel);
2234 cel->vlp[0] = NULL;
2235 cel->vlp[1] = NULL;
2236 cel->vlp[2] = NULL;
2237 }
2238 cache_lock_buckets_cel(cel, blps[0], blps[1]);
2239}
2240
2241static void
2242cache_enter_unlock(struct celockstate *cel)

Callers 1

cache_enter_dotdot_prepFunction · 0.85

Calls 6

cache_lock_vnodes_celFunction · 0.85
NCP2BUCKETLOCKFunction · 0.85
cache_lock_vnodes_cel_3Function · 0.85
VP2VNODELOCKFunction · 0.85
cache_unlock_vnodes_celFunction · 0.85
cache_lock_buckets_celFunction · 0.85

Tested by

no test coverage detected