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

Function cache_neg_demote_locked

freebsd/kern/vfs_cache.c:1158–1173  ·  view source on GitHub ↗

* Move a hot negative entry to the cold list. */

Source from the content-addressed store, hash-verified

1156 * Move a hot negative entry to the cold list.
1157 */
1158static void
1159cache_neg_demote_locked(struct namecache *ncp)
1160{
1161 struct neglist *nl;
1162 struct negstate *ns;
1163
1164 ns = NCP2NEGSTATE(ncp);
1165 nl = NCP2NEGLIST(ncp);
1166 mtx_assert(&nl->nl_lock, MA_OWNED);
1167 MPASS(ns->neg_flag & NEG_HOT);
1168 TAILQ_REMOVE(&nl->nl_hotlist, ncp, nc_dst);
1169 TAILQ_INSERT_TAIL(&nl->nl_list, ncp, nc_dst);
1170 nl->nl_hotnum--;
1171 ns->neg_flag &= ~NEG_HOT;
1172 atomic_store_char(&ns->neg_hit, 0);
1173}
1174
1175/*
1176 * Move a negative entry to the hot list if it matches the lookup.

Callers 1

cache_neg_evictFunction · 0.85

Calls 3

NCP2NEGSTATEFunction · 0.85
NCP2NEGLISTFunction · 0.85
mtx_assertFunction · 0.85

Tested by

no test coverage detected