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

Function nchinittbl

freebsd/kern/vfs_cache.c:2492–2505  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2490}
2491
2492static struct nchashhead *
2493nchinittbl(u_long elements, u_long *hashmask)
2494{
2495 struct nchashhead *hashtbl;
2496 u_long hashsize, i;
2497
2498 hashsize = cache_roundup_2(elements) / 2;
2499
2500 hashtbl = malloc((u_long)hashsize * sizeof(*hashtbl), M_VFSCACHE, M_WAITOK);
2501 for (i = 0; i < hashsize; i++)
2502 CK_SLIST_INIT(&hashtbl[i]);
2503 *hashmask = hashsize - 1;
2504 return (hashtbl);
2505}
2506
2507static void
2508ncfreetbl(struct nchashhead *hashtbl)

Callers 2

nchinitFunction · 0.85
cache_changesizeFunction · 0.85

Calls 2

cache_roundup_2Function · 0.85
mallocFunction · 0.85

Tested by

no test coverage detected