Lines Matching refs:cl

167 #define	CALLOUT_LIST_INSERT(hash, cl)				\  argument
168 CALLOUT_HASH_INSERT(hash, cl, cl_next, cl_prev)
170 #define CALLOUT_LIST_APPEND(hash, cl) \ argument
171 CALLOUT_HASH_APPEND(hash, cl, cl_next, cl_prev)
173 #define CALLOUT_LIST_DELETE(hash, cl) \ argument
174 CALLOUT_HASH_DELETE(hash, cl, cl_next, cl_prev)
176 #define CALLOUT_LIST_BEFORE(cl, nextcl) \ argument
178 (cl)->cl_prev = (nextcl)->cl_prev; \
179 (cl)->cl_next = (nextcl); \
180 (nextcl)->cl_prev = (cl); \
181 if (cl->cl_prev != NULL) \
182 cl->cl_prev->cl_next = cl; \
196 callout_list_t *cl; \
198 cl = ct->ct_expired.ch_head; \
199 if (cl == NULL) { \
205 } else if ((cl->cl_next == NULL) && \
206 (cl->cl_callouts.ch_head == cl->cl_callouts.ch_tail)) { \
243 #define CALLOUT_LIST_FREE(ct, cl) \ argument
245 cl->cl_next = ct->ct_lfree; \
246 ct->ct_lfree = cl; \
247 cl->cl_flags |= CALLOUT_LIST_FLAG_FREE; \
253 #define CALLOUT_FREE(ct, cl) \ argument
300 callout_list_t *cl; in callout_list_alloc() local
305 cl = kmem_cache_alloc(ct->ct_lcache, KM_NOSLEEP); in callout_list_alloc()
306 if (cl == NULL) { in callout_list_alloc()
308 cl = kmem_alloc_tryhard(size, &size, KM_NOSLEEP | KM_PANIC); in callout_list_alloc()
310 bzero(cl, sizeof (callout_list_t)); in callout_list_alloc()
313 CALLOUT_LIST_FREE(ct, cl); in callout_list_alloc()
322 callout_list_t *cl; in callout_list_get() local
336 for (cl = ct->ct_clhash[hash].ch_head; (cl != NULL); cl = cl->cl_next) { in callout_list_get()
342 if (cl->cl_flags & CALLOUT_LIST_FLAG_NANO) in callout_list_get()
345 if ((cl->cl_expiration == expiration) && in callout_list_get()
346 ((cl->cl_flags & clflags) == (flags & clflags))) in callout_list_get()
347 return (cl); in callout_list_get()
358 callout_queue_add(callout_table_t *ct, callout_list_t *cl) in callout_queue_add() argument
363 expiration = cl->cl_expiration; in callout_queue_add()
366 CALLOUT_LIST_INSERT(ct->ct_queue, cl); in callout_queue_add()
372 CALLOUT_LIST_BEFORE(cl, nextcl); in callout_queue_add()
377 CALLOUT_LIST_APPEND(ct->ct_queue, cl); in callout_queue_add()
387 callout_queue_insert(callout_table_t *ct, callout_list_t *cl) in callout_queue_insert() argument
389 cl->cl_flags |= CALLOUT_LIST_FLAG_QUEUED; in callout_queue_insert()
401 if (callout_queue_add(ct, cl) && (ct->ct_suspend == 0)) in callout_queue_insert()
402 (void) cyclic_reprogram(ct->ct_qcyclic, cl->cl_expiration); in callout_queue_insert()
411 callout_list_t *cl; in callout_queue_delete() local
417 while ((cl = ct->ct_queue.ch_head) != NULL) { in callout_queue_delete()
418 if (cl->cl_expiration > now) in callout_queue_delete()
420 cl->cl_flags &= ~CALLOUT_LIST_FLAG_QUEUED; in callout_queue_delete()
421 CALLOUT_LIST_DELETE(ct->ct_queue, cl); in callout_queue_delete()
422 CALLOUT_LIST_APPEND(ct->ct_expired, cl); in callout_queue_delete()
429 if ((cl == NULL) || (ct->ct_suspend > 0)) in callout_queue_delete()
432 (void) cyclic_reprogram(ct->ct_qcyclic, cl->cl_expiration); in callout_queue_delete()
434 return (cl->cl_expiration); in callout_queue_delete()
440 callout_list_t *firstcl, *cl; in callout_queue_process() local
463 while ((cl = temp.ch_head) != NULL) { in callout_queue_process()
464 CALLOUT_LIST_DELETE(temp, cl); in callout_queue_process()
473 if ((cl->cl_expiration <= now) || in callout_queue_process()
474 (timechange && ((cl->cl_flags & clflags) == clflags))) { in callout_queue_process()
475 cl->cl_flags &= ~CALLOUT_LIST_FLAG_QUEUED; in callout_queue_process()
476 CALLOUT_LIST_APPEND(ct->ct_expired, cl); in callout_queue_process()
485 if (delta && !(cl->cl_flags & CALLOUT_LIST_FLAG_ABSOLUTE)) { in callout_queue_process()
486 expiration = cl->cl_expiration + delta; in callout_queue_process()
489 cl->cl_expiration = expiration; in callout_queue_process()
492 (void) callout_queue_add(ct, cl); in callout_queue_process()
504 cl = ct->ct_queue.ch_head; in callout_queue_process()
505 if (cl == NULL) in callout_queue_process()
508 return (cl->cl_expiration); in callout_queue_process()
638 callout_heap_insert(callout_table_t *ct, callout_list_t *cl) in callout_heap_insert() argument
643 cl->cl_flags |= CALLOUT_LIST_FLAG_HEAPED; in callout_heap_insert()
648 ct->ct_heap[ct->ct_heap_num].ch_expiration = cl->cl_expiration; in callout_heap_insert()
649 ct->ct_heap[ct->ct_heap_num].ch_list = cl; in callout_heap_insert()
663 (void) cyclic_reprogram(ct->ct_cyclic, cl->cl_expiration); in callout_heap_insert()
753 callout_list_t *cl; in callout_heap_delete() local
773 cl = heap->ch_list; in callout_heap_delete()
774 ASSERT(expiration == cl->cl_expiration); in callout_heap_delete()
776 if (cl->cl_callouts.ch_head == NULL) { in callout_heap_delete()
781 CALLOUT_LIST_DELETE(ct->ct_clhash[hash], cl); in callout_heap_delete()
782 CALLOUT_LIST_FREE(ct, cl); in callout_heap_delete()
797 cl->cl_flags &= ~CALLOUT_LIST_FLAG_HEAPED; in callout_heap_delete()
798 CALLOUT_LIST_DELETE(ct->ct_clhash[hash], cl); in callout_heap_delete()
799 CALLOUT_LIST_APPEND(ct->ct_expired, cl); in callout_heap_delete()
863 callout_list_t *cl; in callout_heap_process() local
899 cl = heap[i].ch_list; in callout_heap_process()
904 if (cl->cl_callouts.ch_head == NULL) { in callout_heap_process()
905 hash = CALLOUT_CLHASH(cl->cl_expiration); in callout_heap_process()
906 CALLOUT_LIST_DELETE(ct->ct_clhash[hash], cl); in callout_heap_process()
907 CALLOUT_LIST_FREE(ct, cl); in callout_heap_process()
918 if ((cl->cl_expiration <= now) || in callout_heap_process()
919 (timechange && ((cl->cl_flags & clflags) == clflags))) { in callout_heap_process()
920 hash = CALLOUT_CLHASH(cl->cl_expiration); in callout_heap_process()
921 cl->cl_flags &= ~CALLOUT_LIST_FLAG_HEAPED; in callout_heap_process()
922 CALLOUT_LIST_DELETE(ct->ct_clhash[hash], cl); in callout_heap_process()
923 CALLOUT_LIST_APPEND(ct->ct_expired, cl); in callout_heap_process()
932 if (delta && !(cl->cl_flags & CALLOUT_LIST_FLAG_ABSOLUTE)) { in callout_heap_process()
933 hash = CALLOUT_CLHASH(cl->cl_expiration); in callout_heap_process()
934 CALLOUT_LIST_DELETE(ct->ct_clhash[hash], cl); in callout_heap_process()
935 expiration = cl->cl_expiration + delta; in callout_heap_process()
939 cl->cl_expiration = expiration; in callout_heap_process()
940 hash = CALLOUT_CLHASH(cl->cl_expiration); in callout_heap_process()
941 if (cl->cl_flags & CALLOUT_LIST_FLAG_NANO) { in callout_heap_process()
942 CALLOUT_LIST_APPEND(ct->ct_clhash[hash], cl); in callout_heap_process()
944 CALLOUT_LIST_INSERT(ct->ct_clhash[hash], cl); in callout_heap_process()
987 callout_list_t *cl; in timeout_generic() local
1108 cl = callout_list_get(ct, expiration, clflags, hash); in timeout_generic()
1109 if (cl == NULL) { in timeout_generic()
1114 if ((cl = ct->ct_lfree) == NULL) { in timeout_generic()
1127 ct->ct_lfree = cl->cl_next; in timeout_generic()
1128 cl->cl_expiration = expiration; in timeout_generic()
1129 cl->cl_flags = clflags; in timeout_generic()
1140 callout_queue_insert(ct, cl); in timeout_generic()
1156 CALLOUT_LIST_APPEND(ct->ct_clhash[hash], cl); in timeout_generic()
1158 CALLOUT_LIST_INSERT(ct->ct_clhash[hash], cl); in timeout_generic()
1166 callout_heap_insert(ct, cl); in timeout_generic()
1173 if (cl->cl_callouts.ch_head == NULL) in timeout_generic()
1177 cp->c_list = cl; in timeout_generic()
1284 callout_list_t *cl; in untimeout_generic() local
1318 cl = cp->c_list; in untimeout_generic()
1319 expiration = cl->cl_expiration; in untimeout_generic()
1333 if (cl->cl_callouts.ch_head == NULL) { in untimeout_generic()
1334 flags = cl->cl_flags; in untimeout_generic()
1338 CALLOUT_LIST_DELETE(ct->ct_queue, cl); in untimeout_generic()
1339 CALLOUT_LIST_FREE(ct, cl); in untimeout_generic()
1341 CALLOUT_LIST_DELETE(ct->ct_expired, cl); in untimeout_generic()
1342 CALLOUT_LIST_FREE(ct, cl); in untimeout_generic()
1454 callout_list_expire(callout_table_t *ct, callout_list_t *cl) in callout_list_expire() argument
1459 ASSERT(cl != NULL); in callout_list_expire()
1461 for (cp = cl->cl_callouts.ch_head; cp != NULL; cp = cnext) { in callout_list_expire()
1516 callout_list_t *cl, *clnext; in callout_expire() local
1520 for (cl = ct->ct_expired.ch_head; (cl != NULL); cl = clnext) { in callout_expire()
1524 callout_list_expire(ct, cl); in callout_expire()
1526 clnext = cl->cl_next; in callout_expire()
1527 if (cl->cl_callouts.ch_head == NULL) { in callout_expire()
1531 CALLOUT_LIST_DELETE(ct->ct_expired, cl); in callout_expire()
1532 CALLOUT_LIST_FREE(ct, cl); in callout_expire()