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

Function cache_neg_hit_prep

freebsd/kern/vfs_cache.c:1103–1118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1101#define CACHE_NEG_PROMOTION_THRESH 2
1102
1103static bool
1104cache_neg_hit_prep(struct namecache *ncp)
1105{
1106 struct negstate *ns;
1107 u_char n;
1108
1109 ns = NCP2NEGSTATE(ncp);
1110 n = atomic_load_char(&ns->neg_hit);
1111 for (;;) {
1112 if (n >= CACHE_NEG_PROMOTION_THRESH)
1113 return (false);
1114 if (atomic_fcmpset_8(&ns->neg_hit, &n, n + 1))
1115 break;
1116 }
1117 return (n + 1 == CACHE_NEG_PROMOTION_THRESH);
1118}
1119
1120/*
1121 * Nothing to do here but it is provided for completeness as some

Callers 4

cache_lookup_dotdotFunction · 0.85
cache_lookup_fallbackFunction · 0.85
cache_lookupFunction · 0.85
cache_fplookup_negFunction · 0.85

Calls 2

NCP2NEGSTATEFunction · 0.85
atomic_fcmpset_8Function · 0.85

Tested by

no test coverage detected