Lines Matching refs:shp

56 fmd_serd_hash_create(fmd_serd_hash_t *shp)  in fmd_serd_hash_create()  argument
58 shp->sh_hashlen = fmd.d_str_buckets; in fmd_serd_hash_create()
59 shp->sh_hash = fmd_zalloc(sizeof (void *) * shp->sh_hashlen, FMD_SLEEP); in fmd_serd_hash_create()
60 shp->sh_count = 0; in fmd_serd_hash_create()
64 fmd_serd_hash_destroy(fmd_serd_hash_t *shp) in fmd_serd_hash_destroy() argument
69 for (i = 0; i < shp->sh_hashlen; i++) { in fmd_serd_hash_destroy()
70 for (sgp = shp->sh_hash[i]; sgp != NULL; sgp = ngp) { in fmd_serd_hash_destroy()
76 fmd_free(shp->sh_hash, sizeof (void *) * shp->sh_hashlen); in fmd_serd_hash_destroy()
77 bzero(shp, sizeof (fmd_serd_hash_t)); in fmd_serd_hash_destroy()
81 fmd_serd_hash_apply(fmd_serd_hash_t *shp, fmd_serd_eng_f *func, void *arg) in fmd_serd_hash_apply() argument
86 for (i = 0; i < shp->sh_hashlen; i++) { in fmd_serd_hash_apply()
87 for (sgp = shp->sh_hash[i]; sgp != NULL; sgp = sgp->sg_next) in fmd_serd_hash_apply()
93 fmd_serd_hash_count(fmd_serd_hash_t *shp) in fmd_serd_hash_count() argument
95 return (shp->sh_count); in fmd_serd_hash_count()
99 fmd_serd_hash_contains(fmd_serd_hash_t *shp, fmd_event_t *ep) in fmd_serd_hash_contains() argument
104 for (i = 0; i < shp->sh_hashlen; i++) { in fmd_serd_hash_contains()
105 for (sgp = shp->sh_hash[i]; sgp != NULL; sgp = sgp->sg_next) { in fmd_serd_hash_contains()
117 fmd_serd_eng_insert(fmd_serd_hash_t *shp, in fmd_serd_eng_insert() argument
120 uint_t h = fmd_strhash(name) % shp->sh_hashlen; in fmd_serd_eng_insert()
123 sgp->sg_next = shp->sh_hash[h]; in fmd_serd_eng_insert()
124 shp->sh_hash[h] = sgp; in fmd_serd_eng_insert()
125 shp->sh_count++; in fmd_serd_eng_insert()
131 fmd_serd_eng_lookup(fmd_serd_hash_t *shp, const char *name) in fmd_serd_eng_lookup() argument
133 uint_t h = fmd_strhash(name) % shp->sh_hashlen; in fmd_serd_eng_lookup()
136 for (sgp = shp->sh_hash[h]; sgp != NULL; sgp = sgp->sg_next) { in fmd_serd_eng_lookup()
145 fmd_serd_eng_delete(fmd_serd_hash_t *shp, const char *name) in fmd_serd_eng_delete() argument
147 uint_t h = fmd_strhash(name) % shp->sh_hashlen; in fmd_serd_eng_delete()
148 fmd_serd_eng_t *sgp, **pp = &shp->sh_hash[h]; in fmd_serd_eng_delete()
160 ASSERT(shp->sh_count != 0); in fmd_serd_eng_delete()
161 shp->sh_count--; in fmd_serd_eng_delete()