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

Function cache_neg_evict_select_entry

freebsd/kern/vfs_cache.c:1314–1339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1312}
1313
1314static struct namecache *
1315cache_neg_evict_select_entry(struct neglist *nl)
1316{
1317 struct namecache *ncp, *lncp;
1318 struct negstate *ns, *lns;
1319 int i;
1320
1321 mtx_assert(&nl->nl_evict_lock, MA_OWNED);
1322 mtx_assert(&nl->nl_lock, MA_OWNED);
1323 ncp = TAILQ_FIRST(&nl->nl_list);
1324 if (ncp == NULL)
1325 return (NULL);
1326 lncp = ncp;
1327 lns = NCP2NEGSTATE(lncp);
1328 for (i = 1; i < 4; i++) {
1329 ncp = TAILQ_NEXT(ncp, nc_dst);
1330 if (ncp == NULL)
1331 break;
1332 ns = NCP2NEGSTATE(ncp);
1333 if (ns->neg_hit < lns->neg_hit) {
1334 lncp = ncp;
1335 lns = ns;
1336 }
1337 }
1338 return (lncp);
1339}
1340
1341static bool
1342cache_neg_evict(void)

Callers 1

cache_neg_evictFunction · 0.85

Calls 2

mtx_assertFunction · 0.85
NCP2NEGSTATEFunction · 0.85

Tested by

no test coverage detected