FreeBSD/sys/kern/uipc_shm.c
/*
 * Dictionary management.  We maintain an in-kernel dictionary to map
 * paths to shmfd objects.  We use the FNV hash on the path to store
 * the mappings in a hash table.
 */
Dictionary management.  We maintain an in-kernel dictionary to map
paths to shmfd objects.  We use the FNV hash on the path to store
the mappings in a hash table.
Dictionary management . We maintain an in - kernel dictionary to map paths to shmfd objects . We use the FNV hash on the path to store the mappings in a hash table .
static void
shm_init(void *arg)
{
	mtx_init(&shm_timestamp_lock, "shm timestamps", NULL, MTX_DEF);
	sx_init(&shm_dict_lock, "shm dictionary");
	shm_dictionary = hashinit(1024, M_SHMFD, &shm_hash);
	shm_ino_unr = new_unrhdr(1, INT32_MAX, NULL);
	KASSERT(shm_ino_unr != NULL, ("shm fake inodes not initialized"));
	shm_dev_ino = devfs_alloc_cdp_inode();
	KASSERT(shm_dev_ino > 0, ("shm dev inode not initialized"));
}
static void shm_init ( void * arg ) { mtx_init ( & shm_timestamp_lock , " " , NULL , MTX_DEF ) ; sx_init ( & shm_dict_lock , " " ) ; shm_dictionary = hashinit ( 1024 , M_SHMFD , & shm_hash ) ; shm_ino_unr = new_unrhdr ( 1 , INT32_MAX , NULL ) ; KASSERT ( shm_ino_unr != NULL , ( " " ) ) ; shm_dev_ino = devfs_alloc_cdp_inode ( ) ; KASSERT ( shm_dev_ino > 0 , ( " " ) ) ; }
Dictionary management.
Dictionary management .