Lines Matching refs:cl
166 #define CALLOUT_LIST_INSERT(hash, cl) \ argument
167 CALLOUT_HASH_INSERT(hash, cl, cl_next, cl_prev)
169 #define CALLOUT_LIST_APPEND(hash, cl) \ argument
170 CALLOUT_HASH_APPEND(hash, cl, cl_next, cl_prev)
172 #define CALLOUT_LIST_DELETE(hash, cl) \ argument
173 CALLOUT_HASH_DELETE(hash, cl, cl_next, cl_prev)
175 #define CALLOUT_LIST_BEFORE(cl, nextcl) \ argument
177 (cl)->cl_prev = (nextcl)->cl_prev; \
178 (cl)->cl_next = (nextcl); \
179 (nextcl)->cl_prev = (cl); \
180 if (cl->cl_prev != NULL) \
181 cl->cl_prev->cl_next = cl; \
195 callout_list_t *cl; \
197 cl = ct->ct_expired.ch_head; \
198 if (cl == NULL) { \
204 } else if ((cl->cl_next == NULL) && \
205 (cl->cl_callouts.ch_head == cl->cl_callouts.ch_tail)) { \
242 #define CALLOUT_LIST_FREE(ct, cl) \ argument
244 cl->cl_next = ct->ct_lfree; \
245 ct->ct_lfree = cl; \
246 cl->cl_flags |= CALLOUT_LIST_FLAG_FREE; \
252 #define CALLOUT_FREE(ct, cl) \ argument
299 callout_list_t *cl; in callout_list_alloc() local
304 cl = kmem_cache_alloc(ct->ct_lcache, KM_NOSLEEP); in callout_list_alloc()
305 if (cl == NULL) { in callout_list_alloc()
307 cl = kmem_alloc_tryhard(size, &size, KM_NOSLEEP | KM_PANIC); in callout_list_alloc()
309 bzero(cl, sizeof (callout_list_t)); in callout_list_alloc()
312 CALLOUT_LIST_FREE(ct, cl); in callout_list_alloc()
321 callout_list_t *cl; in callout_list_get() local
335 for (cl = ct->ct_clhash[hash].ch_head; (cl != NULL); cl = cl->cl_next) { in callout_list_get()
341 if (cl->cl_flags & CALLOUT_LIST_FLAG_NANO) in callout_list_get()
344 if ((cl->cl_expiration == expiration) && in callout_list_get()
345 ((cl->cl_flags & clflags) == (flags & clflags))) in callout_list_get()
346 return (cl); in callout_list_get()
357 callout_queue_add(callout_table_t *ct, callout_list_t *cl) in callout_queue_add() argument
362 expiration = cl->cl_expiration; in callout_queue_add()
365 CALLOUT_LIST_INSERT(ct->ct_queue, cl); in callout_queue_add()
371 CALLOUT_LIST_BEFORE(cl, nextcl); in callout_queue_add()
376 CALLOUT_LIST_APPEND(ct->ct_queue, cl); in callout_queue_add()
386 callout_queue_insert(callout_table_t *ct, callout_list_t *cl) in callout_queue_insert() argument
388 cl->cl_flags |= CALLOUT_LIST_FLAG_QUEUED; in callout_queue_insert()
400 if (callout_queue_add(ct, cl) && (ct->ct_suspend == 0)) in callout_queue_insert()
401 (void) cyclic_reprogram(ct->ct_qcyclic, cl->cl_expiration); in callout_queue_insert()
410 callout_list_t *cl; in callout_queue_delete() local
416 while ((cl = ct->ct_queue.ch_head) != NULL) { in callout_queue_delete()
417 if (cl->cl_expiration > now) in callout_queue_delete()
419 cl->cl_flags &= ~CALLOUT_LIST_FLAG_QUEUED; in callout_queue_delete()
420 CALLOUT_LIST_DELETE(ct->ct_queue, cl); in callout_queue_delete()
421 CALLOUT_LIST_APPEND(ct->ct_expired, cl); in callout_queue_delete()
428 if ((cl == NULL) || (ct->ct_suspend > 0)) in callout_queue_delete()
431 (void) cyclic_reprogram(ct->ct_qcyclic, cl->cl_expiration); in callout_queue_delete()
433 return (cl->cl_expiration); in callout_queue_delete()
439 callout_list_t *firstcl, *cl; in callout_queue_process() local
462 while ((cl = temp.ch_head) != NULL) { in callout_queue_process()
463 CALLOUT_LIST_DELETE(temp, cl); in callout_queue_process()
472 if ((cl->cl_expiration <= now) || in callout_queue_process()
473 (timechange && ((cl->cl_flags & clflags) == clflags))) { in callout_queue_process()
474 cl->cl_flags &= ~CALLOUT_LIST_FLAG_QUEUED; in callout_queue_process()
475 CALLOUT_LIST_APPEND(ct->ct_expired, cl); in callout_queue_process()
484 if (delta && !(cl->cl_flags & CALLOUT_LIST_FLAG_ABSOLUTE)) { in callout_queue_process()
485 expiration = cl->cl_expiration + delta; in callout_queue_process()
488 cl->cl_expiration = expiration; in callout_queue_process()
491 (void) callout_queue_add(ct, cl); in callout_queue_process()
503 cl = ct->ct_queue.ch_head; in callout_queue_process()
504 if (cl == NULL) in callout_queue_process()
507 return (cl->cl_expiration); in callout_queue_process()
637 callout_heap_insert(callout_table_t *ct, callout_list_t *cl) in callout_heap_insert() argument
642 cl->cl_flags |= CALLOUT_LIST_FLAG_HEAPED; in callout_heap_insert()
647 ct->ct_heap[ct->ct_heap_num].ch_expiration = cl->cl_expiration; in callout_heap_insert()
648 ct->ct_heap[ct->ct_heap_num].ch_list = cl; in callout_heap_insert()
662 (void) cyclic_reprogram(ct->ct_cyclic, cl->cl_expiration); in callout_heap_insert()
752 callout_list_t *cl; in callout_heap_delete() local
772 cl = heap->ch_list; in callout_heap_delete()
773 ASSERT(expiration == cl->cl_expiration); in callout_heap_delete()
775 if (cl->cl_callouts.ch_head == NULL) { in callout_heap_delete()
780 CALLOUT_LIST_DELETE(ct->ct_clhash[hash], cl); in callout_heap_delete()
781 CALLOUT_LIST_FREE(ct, cl); in callout_heap_delete()
796 cl->cl_flags &= ~CALLOUT_LIST_FLAG_HEAPED; in callout_heap_delete()
797 CALLOUT_LIST_DELETE(ct->ct_clhash[hash], cl); in callout_heap_delete()
798 CALLOUT_LIST_APPEND(ct->ct_expired, cl); in callout_heap_delete()
862 callout_list_t *cl; in callout_heap_process() local
898 cl = heap[i].ch_list; in callout_heap_process()
903 if (cl->cl_callouts.ch_head == NULL) { in callout_heap_process()
904 hash = CALLOUT_CLHASH(cl->cl_expiration); in callout_heap_process()
905 CALLOUT_LIST_DELETE(ct->ct_clhash[hash], cl); in callout_heap_process()
906 CALLOUT_LIST_FREE(ct, cl); in callout_heap_process()
917 if ((cl->cl_expiration <= now) || in callout_heap_process()
918 (timechange && ((cl->cl_flags & clflags) == clflags))) { in callout_heap_process()
919 hash = CALLOUT_CLHASH(cl->cl_expiration); in callout_heap_process()
920 cl->cl_flags &= ~CALLOUT_LIST_FLAG_HEAPED; in callout_heap_process()
921 CALLOUT_LIST_DELETE(ct->ct_clhash[hash], cl); in callout_heap_process()
922 CALLOUT_LIST_APPEND(ct->ct_expired, cl); in callout_heap_process()
931 if (delta && !(cl->cl_flags & CALLOUT_LIST_FLAG_ABSOLUTE)) { in callout_heap_process()
932 hash = CALLOUT_CLHASH(cl->cl_expiration); in callout_heap_process()
933 CALLOUT_LIST_DELETE(ct->ct_clhash[hash], cl); in callout_heap_process()
934 expiration = cl->cl_expiration + delta; in callout_heap_process()
938 cl->cl_expiration = expiration; in callout_heap_process()
939 hash = CALLOUT_CLHASH(cl->cl_expiration); in callout_heap_process()
940 if (cl->cl_flags & CALLOUT_LIST_FLAG_NANO) { in callout_heap_process()
941 CALLOUT_LIST_APPEND(ct->ct_clhash[hash], cl); in callout_heap_process()
943 CALLOUT_LIST_INSERT(ct->ct_clhash[hash], cl); in callout_heap_process()
986 callout_list_t *cl; in timeout_generic() local
1107 cl = callout_list_get(ct, expiration, clflags, hash); in timeout_generic()
1108 if (cl == NULL) { in timeout_generic()
1113 if ((cl = ct->ct_lfree) == NULL) { in timeout_generic()
1126 ct->ct_lfree = cl->cl_next; in timeout_generic()
1127 cl->cl_expiration = expiration; in timeout_generic()
1128 cl->cl_flags = clflags; in timeout_generic()
1139 callout_queue_insert(ct, cl); in timeout_generic()
1155 CALLOUT_LIST_APPEND(ct->ct_clhash[hash], cl); in timeout_generic()
1157 CALLOUT_LIST_INSERT(ct->ct_clhash[hash], cl); in timeout_generic()
1165 callout_heap_insert(ct, cl); in timeout_generic()
1172 if (cl->cl_callouts.ch_head == NULL) in timeout_generic()
1176 cp->c_list = cl; in timeout_generic()
1283 callout_list_t *cl; in untimeout_generic() local
1317 cl = cp->c_list; in untimeout_generic()
1318 expiration = cl->cl_expiration; in untimeout_generic()
1332 if (cl->cl_callouts.ch_head == NULL) { in untimeout_generic()
1333 flags = cl->cl_flags; in untimeout_generic()
1337 CALLOUT_LIST_DELETE(ct->ct_queue, cl); in untimeout_generic()
1338 CALLOUT_LIST_FREE(ct, cl); in untimeout_generic()
1340 CALLOUT_LIST_DELETE(ct->ct_expired, cl); in untimeout_generic()
1341 CALLOUT_LIST_FREE(ct, cl); in untimeout_generic()
1453 callout_list_expire(callout_table_t *ct, callout_list_t *cl) in callout_list_expire() argument
1458 ASSERT(cl != NULL); in callout_list_expire()
1460 for (cp = cl->cl_callouts.ch_head; cp != NULL; cp = cnext) { in callout_list_expire()
1515 callout_list_t *cl, *clnext; in callout_expire() local
1519 for (cl = ct->ct_expired.ch_head; (cl != NULL); cl = clnext) { in callout_expire()
1523 callout_list_expire(ct, cl); in callout_expire()
1525 clnext = cl->cl_next; in callout_expire()
1526 if (cl->cl_callouts.ch_head == NULL) { in callout_expire()
1530 CALLOUT_LIST_DELETE(ct->ct_expired, cl); in callout_expire()
1531 CALLOUT_LIST_FREE(ct, cl); in callout_expire()