Lines Matching refs:lqe

163 log_queue_entry_state(const log_queue_entry_t lqe)  in log_queue_entry_state()  argument
165 log_queue_entry_state_t state = read_dependency(&lqe->lqe_state); in log_queue_entry_state()
177 log_queue_entry_t lqe = logmem_alloc(&lq->lq_mem[i], &lqe_size); in log_queue_entry_alloc() local
178 if (lqe) { in log_queue_entry_alloc()
182 lqe->lqe_size = (uint16_t)lqe_size; in log_queue_entry_alloc()
183 lqe->lqe_lm_id = i; in log_queue_entry_alloc()
184 return lqe; in log_queue_entry_alloc()
192 log_queue_entry_free(log_queue_t lq, log_queue_entry_t lqe) in log_queue_entry_free() argument
194 const size_t lqe_size = lqe->lqe_size; in log_queue_entry_free()
195 const uint16_t lqe_lm_id = lqe->lqe_lm_id; in log_queue_entry_free()
197 bzero(lqe, lqe_size); in log_queue_entry_free()
198 logmem_free(&lq->lq_mem[lqe_lm_id], lqe, lqe_size); in log_queue_entry_free()
205 log_queue_entry_t lqe = log_queue_entry_alloc(lq, log_queue_entry_size(lp)); in log_queue_add_entry() local
206 if (!lqe) { in log_queue_add_entry()
210 assert(lqe->lqe_size >= lp->lp_data_size); in log_queue_add_entry()
212 lqe->lqe_payload = *lp; in log_queue_add_entry()
213 (void) memcpy((uint8_t *)lqe + sizeof(*lqe), lp_data, lqe->lqe_payload.lp_data_size); in log_queue_add_entry()
214 STAILQ_INSERT_TAIL(&lq->lq_log_list, lqe, lqe_link); in log_queue_add_entry()
215 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_STORED); in log_queue_add_entry()
228 log_queue_entry_t lqe, lqe_tmp; in dispatch_list_cleanup() local
231 STAILQ_FOREACH_SAFE(lqe, &lq->lq_dispatch_list, lqe_link, lqe_tmp) { in dispatch_list_cleanup()
232 log_queue_entry_state_t lqe_state = log_queue_entry_state(lqe); in dispatch_list_cleanup()
236 STAILQ_REMOVE(&lq->lq_dispatch_list, lqe, log_queue_entry, lqe_link); in dispatch_list_cleanup()
237 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_INVALID); in dispatch_list_cleanup()
238 log_queue_entry_free(lq, lqe); in dispatch_list_cleanup()
255 log_queue_entry_t lqe, lqe_tmp; in log_dispatch_prepare() local
258 STAILQ_FOREACH(lqe, &lq->lq_dispatch_list, lqe_link) { in log_dispatch_prepare()
259 log_queue_entry_state_t lqe_state = log_queue_entry_state(lqe); in log_dispatch_prepare()
263 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_DISPATCHED); in log_dispatch_prepare()
264 buf[collected++] = lqe; in log_dispatch_prepare()
273 STAILQ_FOREACH_SAFE(lqe, &lq->lq_log_list, lqe_link, lqe_tmp) { in log_dispatch_prepare()
274 assert(log_queue_entry_state(lqe) == LOG_QUEUE_ENTRY_STATE_STORED); in log_dispatch_prepare()
276 STAILQ_REMOVE(&lq->lq_log_list, lqe, log_queue_entry, lqe_link); in log_dispatch_prepare()
277 STAILQ_INSERT_TAIL(&lq->lq_dispatch_list, lqe, lqe_link); in log_dispatch_prepare()
278 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_DISPATCHED); in log_dispatch_prepare()
280 buf[collected++] = lqe; in log_dispatch_prepare()
298 const log_queue_entry_t lqe = logs[i]; in log_queue_dispatch_logs() local
299 log_queue_entry_state_t lqe_state = log_queue_entry_state(lqe); in log_queue_dispatch_logs()
302 const log_payload_t lqe_lp = &lqe->lqe_payload; in log_queue_dispatch_logs()
310 const void *lp_data = (uint8_t *)lqe + sizeof(*lqe); in log_queue_dispatch_logs()
319 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_SENT); in log_queue_dispatch_logs()
322 publish(&lqe->lqe_state, LOG_QUEUE_ENTRY_STATE_FAILED); in log_queue_dispatch_logs()