FreeBSD/sys/kern/subr_witness.c
/*
 * Initializes the two witness hash tables. Called exactly once from
 * witness_initialize().
 */
Initializes the two witness hash tables. Called exactly once from
witness_initialize().
Initializes the two witness hash tables . Called exactly once from witness_initialize () .
static void
witness_init_hash_tables(void)
{
	int i;
	MPASS(witness_cold);
	for (i = 0; i < WITNESS_HASH_SIZE; i++)
		w_hash.wh_array[i] = NULL;
	w_hash.wh_size = WITNESS_HASH_SIZE;
	w_hash.wh_count = 0;
	w_lofree = NULL;
	for (i = 0; i < WITNESS_LO_DATA_COUNT; i++) {
		memset(&w_lodata[i], 0, sizeof(w_lodata[i]));
		w_lodata[i].wlod_next = w_lofree;
		w_lofree = &w_lodata[i];
	}
	w_lohash.wloh_size = WITNESS_LO_HASH_SIZE;
	w_lohash.wloh_count = 0;
	for (i = 0; i < WITNESS_LO_HASH_SIZE; i++)
		w_lohash.wloh_array[i] = NULL;
}
static void witness_init_hash_tables ( void ) { int i ; MPASS ( witness_cold ) ; for ( i = 0 ; i < WITNESS_HASH_SIZE ; i ++ ) w_hash . wh_array [ i ] = NULL ; w_hash . wh_size = WITNESS_HASH_SIZE ; w_hash . wh_count = 0 ; w_lofree = NULL ; for ( i = 0 ; i < WITNESS_LO_DATA_COUNT ; i ++ ) { memset ( & w_lodata [ i ] , 0 , sizeof ( w_lodata [ i ] ) ) ; w_lodata [ i ] . wlod_next = w_lofree ; w_lofree = & w_lodata [ i ] ; } w_lohash . wloh_size = WITNESS_LO_HASH_SIZE ; w_lohash . wloh_count = 0 ; for ( i = 0 ; i < WITNESS_LO_HASH_SIZE ; i ++ ) w_lohash . wloh_array [ i ] = NULL ; }
Initializes the two witness hash tables.
Initializes the two witness hash tables .
/* Initialize the hash tables. */ /* Initialize the lock order data hash. */