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

Function ksem_lookup

freebsd/kern/uipc_sem.c:376–389  ·  view source on GitHub ↗

* Dictionary management. We maintain an in-kernel dictionary to map * paths to semaphore objects. We use the FNV hash on the path to * store the mappings in a hash table. */

Source from the content-addressed store, hash-verified

374 * store the mappings in a hash table.
375 */
376static struct ksem *
377ksem_lookup(char *path, Fnv32_t fnv)
378{
379 struct ksem_mapping *map;
380
381 LIST_FOREACH(map, KSEM_HASH(fnv), km_link) {
382 if (map->km_fnv != fnv)
383 continue;
384 if (strcmp(map->km_path, path) == 0)
385 return (map->km_ksem);
386 }
387
388 return (NULL);
389}
390
391static void
392ksem_insert(char *path, Fnv32_t fnv, struct ksem *ks)

Callers 1

ksem_createFunction · 0.85

Calls 1

strcmpFunction · 0.85

Tested by

no test coverage detected