Lines Matching refs:hc_head
94 struct hc_head { struct
123 struct hc_head *hashbase;
260 V_tcp_hostcache.hashbase = (struct hc_head *) in tcp_hc_init()
261 malloc(V_tcp_hostcache.hashsize * sizeof(struct hc_head), in tcp_hc_init()
339 struct hc_head *hc_head; in tcp_hc_lookup() local
344 hc_head = &V_tcp_hostcache.hashbase[HOSTCACHE_HASH(inc)]; in tcp_hc_lookup()
350 CK_SLIST_FOREACH(hc_entry, &hc_head->hch_bucket, hc_q) in tcp_hc_lookup()
452 struct hc_head *hc_head; in tcp_hc_update() local
460 hc_head = &V_tcp_hostcache.hashbase[HOSTCACHE_HASH(inc)]; in tcp_hc_update()
463 THC_LOCK(hc_head); in tcp_hc_update()
464 CK_SLIST_FOREACH(hc_entry, &hc_head->hch_bucket, hc_q) { in tcp_hc_update()
491 if (hc_head->hch_length >= V_tcp_hostcache.bucket_limit || in tcp_hc_update()
501 CK_SLIST_FIRST(&hc_head->hch_bucket)) != NULL) { in tcp_hc_update()
505 CK_SLIST_REMOVE_HEAD(&hc_head->hch_bucket, in tcp_hc_update()
508 THC_UNLOCK(hc_head); in tcp_hc_update()
511 KASSERT(hc_head->hch_length > 0 && in tcp_hc_update()
512 hc_head->hch_length <= V_tcp_hostcache.bucket_limit, in tcp_hc_update()
514 hc_head)); in tcp_hc_update()
515 hc_head->hch_length--; in tcp_hc_update()
526 THC_UNLOCK(hc_head); in tcp_hc_update()
608 CK_SLIST_INSERT_HEAD(&hc_head->hch_bucket, hc_entry, hc_q); in tcp_hc_update()
609 hc_head->hch_length++; in tcp_hc_update()
610 KASSERT(hc_head->hch_length <= V_tcp_hostcache.bucket_limit, in tcp_hc_update()
611 ("tcp_hostcache: bucket length too high at %p", hc_head)); in tcp_hc_update()
614 } else if (hc_entry != CK_SLIST_FIRST(&hc_head->hch_bucket)) { in tcp_hc_update()
618 CK_SLIST_INSERT_HEAD(&hc_head->hch_bucket, hc_entry, hc_q); in tcp_hc_update()
620 THC_UNLOCK(hc_head); in tcp_hc_update()
757 struct hc_head *head; in tcp_hc_purge_internal()