Lines Matching defs:mod_hash
27 * mod_hash: flexible hash table implementation.
48 * The number returned need _not_ be between 0 and nchains. The mod_hash
307 * mod_hash takes hashkey % nchains.
436 mod_hash_t *mod_hash;
439 if ((mod_hash = kmem_zalloc(MH_SIZE(nchains), sleep)) == NULL)
442 mod_hash->mh_name = kmem_alloc(strlen(hname) + 1, sleep);
443 if (mod_hash->mh_name == NULL) {
444 kmem_free(mod_hash, MH_SIZE(nchains));
447 (void) strcpy(mod_hash->mh_name, hname);
449 mod_hash->mh_sleep = sleep;
450 mod_hash->mh_nchains = nchains;
451 mod_hash->mh_kdtor = kdtor;
452 mod_hash->mh_vdtor = vdtor;
453 mod_hash->mh_hashalg = hash_alg;
454 mod_hash->mh_hashalg_data = hash_alg_data;
455 mod_hash->mh_keycmp = keycmp;
457 rw_init(&mod_hash->mh_contents, NULL, RW_DEFAULT, NULL);
463 mod_hash->mh_next = mh_head;
464 mh_head = mod_hash;
467 return (mod_hash);
540 * the hash insertion. this abstraction allows simple use of the mod_hash