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