Lines Matching refs:entry
102 tsd_hash_entry_t *entry; in tsd_hash_search() local
110 entry = list_entry(node, tsd_hash_entry_t, he_list); in tsd_hash_search()
111 if ((entry->he_key == key) && (entry->he_pid == pid)) { in tsd_hash_search()
113 return (entry); in tsd_hash_search()
131 tsd_hash_entry_t *entry; in tsd_hash_dtor() local
134 entry = hlist_entry(work->first, tsd_hash_entry_t, he_list); in tsd_hash_dtor()
135 hlist_del(&entry->he_list); in tsd_hash_dtor()
137 if (entry->he_dtor && entry->he_pid != DTOR_PID) in tsd_hash_dtor()
138 entry->he_dtor(entry->he_value); in tsd_hash_dtor()
140 kmem_free(entry, sizeof (tsd_hash_entry_t)); in tsd_hash_dtor()
159 tsd_hash_entry_t *entry, *dtor_entry, *pid_entry; in tsd_hash_add() local
167 entry = kmem_alloc(sizeof (tsd_hash_entry_t), KM_PUSHPAGE); in tsd_hash_add()
168 if (entry == NULL) in tsd_hash_add()
171 entry->he_key = key; in tsd_hash_add()
172 entry->he_pid = pid; in tsd_hash_add()
173 entry->he_value = value; in tsd_hash_add()
174 INIT_HLIST_NODE(&entry->he_list); in tsd_hash_add()
175 INIT_LIST_HEAD(&entry->he_key_list); in tsd_hash_add()
176 INIT_LIST_HEAD(&entry->he_pid_list); in tsd_hash_add()
181 dtor_entry = tsd_hash_search(table, entry->he_key, DTOR_PID); in tsd_hash_add()
183 entry->he_dtor = dtor_entry->he_dtor; in tsd_hash_add()
186 pid_entry = tsd_hash_search(table, PID_KEY, entry->he_pid); in tsd_hash_add()
194 hlist_add_head(&entry->he_list, &bin->hb_head); in tsd_hash_add()
195 list_add(&entry->he_key_list, &dtor_entry->he_key_list); in tsd_hash_add()
196 list_add(&entry->he_pid_list, &pid_entry->he_pid_list); in tsd_hash_add()
218 tsd_hash_entry_t *tmp_entry, *entry; in tsd_hash_add_key() local
226 entry = kmem_alloc(sizeof (tsd_hash_entry_t), KM_PUSHPAGE); in tsd_hash_add_key()
227 if (entry == NULL) in tsd_hash_add_key()
247 entry->he_key = *keyp = table->ht_key; in tsd_hash_add_key()
248 entry->he_pid = DTOR_PID; in tsd_hash_add_key()
249 entry->he_dtor = dtor; in tsd_hash_add_key()
250 entry->he_value = NULL; in tsd_hash_add_key()
251 INIT_HLIST_NODE(&entry->he_list); in tsd_hash_add_key()
252 INIT_LIST_HEAD(&entry->he_key_list); in tsd_hash_add_key()
253 INIT_LIST_HEAD(&entry->he_pid_list); in tsd_hash_add_key()
259 hlist_add_head(&entry->he_list, &bin->hb_head); in tsd_hash_add_key()
279 tsd_hash_entry_t *entry; in tsd_hash_add_pid() local
284 entry = kmem_alloc(sizeof (tsd_hash_entry_t), KM_PUSHPAGE); in tsd_hash_add_pid()
285 if (entry == NULL) in tsd_hash_add_pid()
289 entry->he_key = PID_KEY; in tsd_hash_add_pid()
290 entry->he_pid = pid; in tsd_hash_add_pid()
291 entry->he_dtor = NULL; in tsd_hash_add_pid()
292 entry->he_value = NULL; in tsd_hash_add_pid()
293 INIT_HLIST_NODE(&entry->he_list); in tsd_hash_add_pid()
294 INIT_LIST_HEAD(&entry->he_key_list); in tsd_hash_add_pid()
295 INIT_LIST_HEAD(&entry->he_pid_list); in tsd_hash_add_pid()
301 hlist_add_head(&entry->he_list, &bin->hb_head); in tsd_hash_add_pid()
316 tsd_hash_del(tsd_hash_table_t *table, tsd_hash_entry_t *entry) in tsd_hash_del() argument
318 hlist_del(&entry->he_list); in tsd_hash_del()
319 list_del_init(&entry->he_key_list); in tsd_hash_del()
320 list_del_init(&entry->he_pid_list); in tsd_hash_del()
371 tsd_hash_entry_t *entry; in tsd_hash_table_fini() local
380 entry = hlist_entry(bin->hb_head.first, in tsd_hash_table_fini()
382 tsd_hash_del(table, entry); in tsd_hash_table_fini()
383 hlist_add_head(&entry->he_list, &work); in tsd_hash_table_fini()
402 tsd_remove_entry(tsd_hash_entry_t *entry) in tsd_remove_entry() argument
412 ASSERT3P(entry, !=, NULL); in tsd_remove_entry()
416 hash = hash_long((ulong_t)entry->he_key * in tsd_remove_entry()
417 (ulong_t)entry->he_pid, table->ht_bits); in tsd_remove_entry()
421 pid_entry = list_entry(entry->he_pid_list.next, tsd_hash_entry_t, in tsd_remove_entry()
426 tsd_hash_del(table, entry); in tsd_remove_entry()
427 hlist_add_head(&entry->he_list, &work); in tsd_remove_entry()
463 tsd_hash_entry_t *entry; in tsd_set() local
477 entry = tsd_hash_search(table, key, pid); in tsd_set()
478 if (entry) { in tsd_set()
479 entry->he_value = value; in tsd_set()
482 tsd_remove_entry(entry); in tsd_set()
491 entry = tsd_hash_search(table, PID_KEY, pid); in tsd_set()
492 if (entry == NULL) { in tsd_set()
514 tsd_hash_entry_t *entry; in tsd_get() local
521 entry = tsd_hash_search(tsd_hash_table, key, curthread->pid); in tsd_get()
522 if (entry == NULL) in tsd_get()
525 return (entry->he_value); in tsd_get()
541 tsd_hash_entry_t *entry; in tsd_get_by_thread() local
548 entry = tsd_hash_search(tsd_hash_table, key, thread->pid); in tsd_get_by_thread()
549 if (entry == NULL) in tsd_get_by_thread()
552 return (entry->he_value); in tsd_get_by_thread()
593 tsd_hash_entry_t *dtor_entry, *entry; in tsd_destroy() local
613 entry = list_entry(dtor_entry->he_key_list.next, in tsd_destroy()
615 ASSERT3U(dtor_entry->he_key, ==, entry->he_key); in tsd_destroy()
616 ASSERT3P(dtor_entry->he_dtor, ==, entry->he_dtor); in tsd_destroy()
618 hash = hash_long((ulong_t)entry->he_key * in tsd_destroy()
619 (ulong_t)entry->he_pid, table->ht_bits); in tsd_destroy()
623 tsd_hash_del(table, entry); in tsd_destroy()
624 hlist_add_head(&entry->he_list, &work); in tsd_destroy()
656 tsd_hash_entry_t *pid_entry, *entry; in tsd_exit() local
677 entry = list_entry(pid_entry->he_pid_list.next, in tsd_exit()
679 ASSERT3U(pid_entry->he_pid, ==, entry->he_pid); in tsd_exit()
681 hash = hash_long((ulong_t)entry->he_key * in tsd_exit()
682 (ulong_t)entry->he_pid, table->ht_bits); in tsd_exit()
686 tsd_hash_del(table, entry); in tsd_exit()
687 hlist_add_head(&entry->he_list, &work); in tsd_exit()