Lines Matching refs:entry

299 	struct mp_request *entry;  in handle_request()  local
306 entry = find_request_by_id(m->id); in handle_request()
307 if (entry != NULL) { in handle_request()
312 entry = malloc(sizeof(*entry)); in handle_request()
313 if (entry == NULL) { in handle_request()
319 memset(entry, 0, sizeof(*entry)); in handle_request()
322 ret = handle_alloc_request(m, entry); in handle_request()
350 free(entry); in handle_request()
379 free(entry->alloc_state.ms); in handle_request()
384 memcpy(&entry->user_req, m, sizeof(*m)); in handle_request()
385 entry->state = REQ_STATE_ACTIVE; in handle_request()
387 TAILQ_INSERT_TAIL(&mp_request_list.list, entry, next); in handle_request()
393 free(entry); in handle_request()
405 struct mp_request *entry; in handle_sync_response() local
413 entry = find_request_by_id(mpreq->id); in handle_sync_response()
414 if (entry == NULL) { in handle_sync_response()
433 if (resp->id != entry->user_req.id) { in handle_sync_response()
444 if (entry->user_req.t == REQ_TYPE_FREE) { in handle_sync_response()
453 resp->id = entry->user_req.id; in handle_sync_response()
461 TAILQ_REMOVE(&mp_request_list.list, entry, next); in handle_sync_response()
462 free(entry); in handle_sync_response()
463 } else if (entry->user_req.t == REQ_TYPE_ALLOC && in handle_sync_response()
465 struct malloc_heap *heap = entry->alloc_state.heap; in handle_sync_response()
472 heap->total_size += entry->alloc_state.map_len; in handle_sync_response()
477 resp->id = entry->user_req.id; in handle_sync_response()
485 TAILQ_REMOVE(&mp_request_list.list, entry, next); in handle_sync_response()
486 free(entry->alloc_state.ms); in handle_sync_response()
487 free(entry); in handle_sync_response()
488 } else if (entry->user_req.t == REQ_TYPE_ALLOC && in handle_sync_response()
495 &entry->alloc_state; in handle_sync_response()
517 rb->id = entry->user_req.id; in handle_sync_response()
531 TAILQ_REMOVE(&mp_request_list.list, entry, next); in handle_sync_response()
533 free(entry); in handle_sync_response()
556 struct mp_request *entry; in handle_rollback_response() local
563 entry = find_request_by_id(mpreq->id); in handle_rollback_response()
564 if (entry == NULL) { in handle_rollback_response()
569 if (entry->user_req.t != REQ_TYPE_ALLOC) { in handle_rollback_response()
586 TAILQ_REMOVE(&mp_request_list.list, entry, next); in handle_rollback_response()
587 free(entry->alloc_state.ms); in handle_rollback_response()
588 free(entry); in handle_rollback_response()
603 struct mp_request *entry; in handle_response() local
607 entry = find_request_by_id(m->id); in handle_response()
608 if (entry != NULL) { in handle_response()
610 entry->user_req.result = m->result; in handle_response()
612 entry->state = REQ_STATE_COMPLETE; in handle_response()
615 pthread_cond_signal(&entry->cond); in handle_response()
700 struct mp_request *entry; in request_to_primary() local
710 entry = malloc(sizeof(*entry)); in request_to_primary()
711 if (entry == NULL) { in request_to_primary()
716 memset(entry, 0, sizeof(*entry)); in request_to_primary()
728 pthread_cond_init(&entry->cond, NULL); in request_to_primary()
746 memcpy(&entry->user_req, user_req, sizeof(*user_req)); in request_to_primary()
749 entry->state = REQ_STATE_ACTIVE; in request_to_primary()
751 TAILQ_INSERT_TAIL(&mp_request_list.list, entry, next); in request_to_primary()
755 ret = pthread_cond_timedwait(&entry->cond, in request_to_primary()
759 if (entry->state != REQ_STATE_COMPLETE) { in request_to_primary()
764 user_req->result = entry->user_req.result; in request_to_primary()
766 TAILQ_REMOVE(&mp_request_list.list, entry, next); in request_to_primary()
767 free(entry); in request_to_primary()
773 free(entry); in request_to_primary()