Lines Matching refs:lqe
174 log_queue_entry_state(const log_queue_entry_t lqe) in log_queue_entry_state() argument
176 log_queue_entry_state_t state = read_dependency(&lqe->lqe_state); in log_queue_entry_state()
188 log_queue_entry_t lqe = logmem_alloc(&lq->lq_mem[i], &lqe_size); in log_queue_entry_alloc() local
189 if (lqe) { in log_queue_entry_alloc()
193 lqe->lqe_size = (uint16_t)lqe_size; in log_queue_entry_alloc()
194 lqe->lqe_lm_id = i; in log_queue_entry_alloc()
195 return lqe; in log_queue_entry_alloc()
203 log_queue_entry_free(log_queue_t lq, log_queue_entry_t lqe) in log_queue_entry_free() argument
205 const size_t lqe_size = lqe->lqe_size; in log_queue_entry_free()
206 const uint16_t lqe_lm_id = lqe->lqe_lm_id; in log_queue_entry_free()
208 bzero(lqe, lqe_size); in log_queue_entry_free()
209 logmem_free(&lq->lq_mem[lqe_lm_id], lqe, lqe_size); in log_queue_entry_free()
216 log_queue_entry_t lqe = log_queue_entry_alloc(lq, log_queue_entry_size(lp)); in log_queue_add_entry() local
217 if (!lqe) { in log_queue_add_entry()
221 assert(lqe->lqe_size >= lp->lp_data_size); in log_queue_add_entry()
223 lqe->lqe_payload = *lp; in log_queue_add_entry()
224 (void) memcpy((uint8_t *)lqe + sizeof(*lqe), lp_data, lqe->lqe_payload.lp_data_size); in log_queue_add_entry()
225 STAILQ_INSERT_TAIL(&lq->lq_log_list, lqe, lqe_link); in log_queue_add_entry()
226 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_STORED); in log_queue_add_entry()
239 log_queue_entry_t lqe, lqe_tmp; in dispatch_list_cleanup() local
242 STAILQ_FOREACH_SAFE(lqe, &lq->lq_dispatch_list, lqe_link, lqe_tmp) { in dispatch_list_cleanup()
243 log_queue_entry_state_t lqe_state = log_queue_entry_state(lqe); in dispatch_list_cleanup()
247 STAILQ_REMOVE(&lq->lq_dispatch_list, lqe, log_queue_entry, lqe_link); in dispatch_list_cleanup()
248 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_INVALID); in dispatch_list_cleanup()
249 log_queue_entry_free(lq, lqe); in dispatch_list_cleanup()
266 log_queue_entry_t lqe, lqe_tmp; in log_dispatch_prepare() local
269 STAILQ_FOREACH(lqe, &lq->lq_dispatch_list, lqe_link) { in log_dispatch_prepare()
270 log_queue_entry_state_t lqe_state = log_queue_entry_state(lqe); in log_dispatch_prepare()
274 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_DISPATCHED); in log_dispatch_prepare()
275 buf[collected++] = lqe; in log_dispatch_prepare()
284 STAILQ_FOREACH_SAFE(lqe, &lq->lq_log_list, lqe_link, lqe_tmp) { in log_dispatch_prepare()
285 assert(log_queue_entry_state(lqe) == LOG_QUEUE_ENTRY_STATE_STORED); in log_dispatch_prepare()
287 STAILQ_REMOVE(&lq->lq_log_list, lqe, log_queue_entry, lqe_link); in log_dispatch_prepare()
288 STAILQ_INSERT_TAIL(&lq->lq_dispatch_list, lqe, lqe_link); in log_dispatch_prepare()
289 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_DISPATCHED); in log_dispatch_prepare()
291 buf[collected++] = lqe; in log_dispatch_prepare()
309 const log_queue_entry_t lqe = logs[i]; in log_queue_dispatch_logs() local
310 log_queue_entry_state_t lqe_state = log_queue_entry_state(lqe); in log_queue_dispatch_logs()
313 const log_payload_t lqe_lp = &lqe->lqe_payload; in log_queue_dispatch_logs()
321 const void *lp_data = (uint8_t *)lqe + sizeof(*lqe); in log_queue_dispatch_logs()
330 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_SENT); in log_queue_dispatch_logs()
333 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_FAILED); in log_queue_dispatch_logs()