Lines Matching refs:entry

239 	struct mp_request *entry;  in handle_request()  local
246 entry = find_request_by_id(m->id); in handle_request()
247 if (entry != NULL) { in handle_request()
252 entry = malloc(sizeof(*entry)); in handle_request()
253 if (entry == NULL) { in handle_request()
259 memset(entry, 0, sizeof(*entry)); in handle_request()
262 ret = handle_alloc_request(m, entry); in handle_request()
294 free(entry); in handle_request()
323 free(entry->alloc_state.ms); in handle_request()
328 memcpy(&entry->user_req, m, sizeof(*m)); in handle_request()
329 entry->state = REQ_STATE_ACTIVE; in handle_request()
331 TAILQ_INSERT_TAIL(&mp_request_list.list, entry, next); in handle_request()
337 free(entry); in handle_request()
349 struct mp_request *entry; in handle_sync_response() local
357 entry = find_request_by_id(mpreq->id); in handle_sync_response()
358 if (entry == NULL) { in handle_sync_response()
377 if (resp->id != entry->user_req.id) { in handle_sync_response()
388 if (entry->user_req.t == REQ_TYPE_FREE) { in handle_sync_response()
397 resp->id = entry->user_req.id; in handle_sync_response()
405 TAILQ_REMOVE(&mp_request_list.list, entry, next); in handle_sync_response()
406 free(entry); in handle_sync_response()
407 } else if (entry->user_req.t == REQ_TYPE_ALLOC && in handle_sync_response()
409 struct malloc_heap *heap = entry->alloc_state.heap; in handle_sync_response()
416 heap->total_size += entry->alloc_state.map_len; in handle_sync_response()
421 resp->id = entry->user_req.id; in handle_sync_response()
429 TAILQ_REMOVE(&mp_request_list.list, entry, next); in handle_sync_response()
430 free(entry->alloc_state.ms); in handle_sync_response()
431 free(entry); in handle_sync_response()
432 } else if (entry->user_req.t == REQ_TYPE_ALLOC && in handle_sync_response()
439 &entry->alloc_state; in handle_sync_response()
461 rb->id = entry->user_req.id; in handle_sync_response()
475 TAILQ_REMOVE(&mp_request_list.list, entry, next); in handle_sync_response()
477 free(entry); in handle_sync_response()
500 struct mp_request *entry; in handle_rollback_response() local
507 entry = find_request_by_id(mpreq->id); in handle_rollback_response()
508 if (entry == NULL) { in handle_rollback_response()
513 if (entry->user_req.t != REQ_TYPE_ALLOC) { in handle_rollback_response()
530 TAILQ_REMOVE(&mp_request_list.list, entry, next); in handle_rollback_response()
531 free(entry->alloc_state.ms); in handle_rollback_response()
532 free(entry); in handle_rollback_response()
547 struct mp_request *entry; in handle_response() local
551 entry = find_request_by_id(m->id); in handle_response()
552 if (entry != NULL) { in handle_response()
554 entry->user_req.result = m->result; in handle_response()
556 entry->state = REQ_STATE_COMPLETE; in handle_response()
559 pthread_cond_signal(&entry->cond); in handle_response()
644 struct mp_request *entry; in request_to_primary() local
654 entry = malloc(sizeof(*entry)); in request_to_primary()
655 if (entry == NULL) { in request_to_primary()
660 memset(entry, 0, sizeof(*entry)); in request_to_primary()
672 pthread_cond_init(&entry->cond, NULL); in request_to_primary()
690 memcpy(&entry->user_req, user_req, sizeof(*user_req)); in request_to_primary()
693 entry->state = REQ_STATE_ACTIVE; in request_to_primary()
695 TAILQ_INSERT_TAIL(&mp_request_list.list, entry, next); in request_to_primary()
699 ret = pthread_cond_timedwait(&entry->cond, in request_to_primary()
703 if (entry->state != REQ_STATE_COMPLETE) { in request_to_primary()
708 user_req->result = entry->user_req.result; in request_to_primary()
710 TAILQ_REMOVE(&mp_request_list.list, entry, next); in request_to_primary()
711 free(entry); in request_to_primary()
717 free(entry); in request_to_primary()