Lines Matching refs:item
217 CQ_ITEM *item; in cq_pop() local
220 item = cq->head; in cq_pop()
221 if (NULL != item) { in cq_pop()
222 cq->head = item->next; in cq_pop()
228 return item; in cq_pop()
234 static void cq_push(CQ *cq, CQ_ITEM *item) { in cq_push() argument
235 item->next = NULL; in cq_push()
239 cq->head = item; in cq_push()
241 cq->tail->next = item; in cq_push()
242 cq->tail = item; in cq_push()
250 CQ_ITEM *item = NULL; in cqi_new() local
253 item = cqi_freelist; in cqi_new()
254 cqi_freelist = item->next; in cqi_new()
258 if (NULL == item) { in cqi_new()
262 item = malloc(sizeof(CQ_ITEM) * ITEMS_PER_ALLOC); in cqi_new()
263 if (NULL == item) { in cqi_new()
276 item[i - 1].next = &item[i]; in cqi_new()
279 item[ITEMS_PER_ALLOC - 1].next = cqi_freelist; in cqi_new()
280 cqi_freelist = &item[1]; in cqi_new()
284 return item; in cqi_new()
291 static void cqi_free(CQ_ITEM *item) { in cqi_free() argument
293 item->next = cqi_freelist; in cqi_free()
294 cqi_freelist = item; in cqi_free()
392 CQ_ITEM *item; in thread_libevent_process() local
404 item = cq_pop(me->new_conn_queue); in thread_libevent_process()
406 if (NULL != item) { in thread_libevent_process()
407 conn *c = conn_new(item->sfd, item->init_state, item->event_flags, in thread_libevent_process()
408 item->read_buffer_size, item->transport, in thread_libevent_process()
411 if (IS_UDP(item->transport)) { in thread_libevent_process()
417 item->sfd); in thread_libevent_process()
419 close(item->sfd); in thread_libevent_process()
424 cqi_free(item); in thread_libevent_process()
453 CQ_ITEM *item = cqi_new(); in dispatch_conn_new() local
455 if (item == NULL) { in dispatch_conn_new()
468 item->sfd = sfd; in dispatch_conn_new()
469 item->init_state = init_state; in dispatch_conn_new()
470 item->event_flags = event_flags; in dispatch_conn_new()
471 item->read_buffer_size = read_buffer_size; in dispatch_conn_new()
472 item->transport = transport; in dispatch_conn_new()
474 cq_push(thread->new_conn_queue, item); in dispatch_conn_new()
490 CQ_ITEM *item = cqi_new(); in redispatch_conn() local
492 if (item == NULL) { in redispatch_conn()
503 item->sfd = sfd; in redispatch_conn()
506 item->event_flags = c->event_flags; in redispatch_conn()
507 item->conn = c; in redispatch_conn()
537 item *item_alloc(char *key, size_t nkey, int flags, rel_time_t exptime, int nbytes) { in item_alloc()
538 item *it; in item_alloc()
548 item *item_get(const char *key, const size_t nkey, conn *c) { in item_get()
549 item *it; in item_get()
558 item *item_touch(const char *key, size_t nkey, uint32_t exptime, conn *c) { in item_touch()
559 item *it; in item_touch()
571 int item_link(item *item) { in item_link() argument
575 hv = hash(ITEM_key(item), item->nkey); in item_link()
577 ret = do_item_link(item, hv); in item_link()
586 void item_remove(item *item) { in item_remove() argument
588 hv = hash(ITEM_key(item), item->nkey); in item_remove()
591 do_item_remove(item); in item_remove()
600 int item_replace(item *old_it, item *new_it, const uint32_t hv) { in item_replace()
607 void item_unlink(item *item) { in item_unlink() argument
609 hv = hash(ITEM_key(item), item->nkey); in item_unlink()
611 do_item_unlink(item, hv); in item_unlink()
618 void item_update(item *item) { in item_update() argument
620 hv = hash(ITEM_key(item), item->nkey); in item_update()
623 do_item_update(item); in item_update()
647 enum store_item_type store_item(item *item, int comm, conn* c) { in store_item() argument
651 hv = hash(ITEM_key(item), item->nkey); in store_item()
653 ret = do_store_item(item, comm, c, hv); in store_item()