| 2490 | } |
| 2491 | |
| 2492 | static struct nchashhead * |
| 2493 | nchinittbl(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 | |
| 2507 | static void |
| 2508 | ncfreetbl(struct nchashhead *hashtbl) |
no test coverage detected