Lines Matching refs:it

258     item *it;  in complete_incr_bin()  local
319 it = item_alloc(key, nkey, 0, realtime(req->message.body.expiration), in complete_incr_bin()
322 if (it != NULL) { in complete_incr_bin()
324 memcpy(ITEM_data(it), tmpbuf, res); in complete_incr_bin()
325 memcpy(ITEM_data(it) + res, "\r\n", 2); in complete_incr_bin()
328 …if (store_item(it, NREAD_ADD, c->thread, NULL, &cas, (settings.use_cas) ? get_cas_id() : 0, CAS_NO… in complete_incr_bin()
335 item_remove(it); /* release our reference */ in complete_incr_bin()
363 item *it = c->item; in complete_update_bin() local
365 c->thread->stats.slab_stats[ITEM_clsid(it)].set_cmds++; in complete_update_bin()
370 if ((it->it_flags & ITEM_CHUNKED) == 0) { in complete_update_bin()
371 *(ITEM_data(it) + it->nbytes - 2) = '\r'; in complete_update_bin()
372 *(ITEM_data(it) + it->nbytes - 1) = '\n'; in complete_update_bin()
386 …ret = store_item(it, c->cmd, c->thread, NULL, &cas, (settings.use_cas) ? get_cas_id() : 0, CAS_NO_… in complete_update_bin()
392 MEMCACHED_COMMAND_ADD(c->sfd, ITEM_key(it), it->nkey, in complete_update_bin()
393 (ret == STORED) ? it->nbytes : -1, cas); in complete_update_bin()
396 MEMCACHED_COMMAND_REPLACE(c->sfd, ITEM_key(it), it->nkey, in complete_update_bin()
397 (ret == STORED) ? it->nbytes : -1, cas); in complete_update_bin()
400 MEMCACHED_COMMAND_APPEND(c->sfd, ITEM_key(it), it->nkey, in complete_update_bin()
401 (ret == STORED) ? it->nbytes : -1, cas); in complete_update_bin()
404 MEMCACHED_COMMAND_PREPEND(c->sfd, ITEM_key(it), it->nkey, in complete_update_bin()
405 (ret == STORED) ? it->nbytes : -1, cas); in complete_update_bin()
408 MEMCACHED_COMMAND_SET(c->sfd, ITEM_key(it), it->nkey, in complete_update_bin()
409 (ret == STORED) ? it->nbytes : -1, cas); in complete_update_bin()
457 item *it; in process_bin_get_or_touch() local
480 it = item_touch(key, nkey, realtime(exptime), c->thread); in process_bin_get_or_touch()
482 it = item_get(key, nkey, c->thread, DO_UPDATE); in process_bin_get_or_touch()
485 if (it) { in process_bin_get_or_touch()
488 uint32_t bodylen = sizeof(rsp->message.body) + (it->nbytes - 2); in process_bin_get_or_touch()
493 c->thread->stats.slab_stats[ITEM_clsid(it)].touch_hits++; in process_bin_get_or_touch()
496 c->thread->stats.lru_hits[it->slabs_clsid]++; in process_bin_get_or_touch()
501 MEMCACHED_COMMAND_TOUCH(c->sfd, ITEM_key(it), it->nkey, in process_bin_get_or_touch()
502 it->nbytes, ITEM_get_cas(it)); in process_bin_get_or_touch()
504 MEMCACHED_COMMAND_GET(c->sfd, ITEM_key(it), it->nkey, in process_bin_get_or_touch()
505 it->nbytes, ITEM_get_cas(it)); in process_bin_get_or_touch()
509 bodylen -= it->nbytes - 2; in process_bin_get_or_touch()
516 rsp->message.header.response.cas = htonll(ITEM_get_cas(it)); in process_bin_get_or_touch()
519 FLAGS_CONV(it, rsp->message.body.flags); in process_bin_get_or_touch()
524 resp_add_iov(c->resp, ITEM_key(it), nkey); in process_bin_get_or_touch()
530 if (it->it_flags & ITEM_HDR) { in process_bin_get_or_touch()
531 if (storage_get_item(c, it, c->resp) != 0) { in process_bin_get_or_touch()
538 } else if ((it->it_flags & ITEM_CHUNKED) == 0) { in process_bin_get_or_touch()
539 resp_add_iov(c->resp, ITEM_data(it), it->nbytes - 2); in process_bin_get_or_touch()
542 resp_add_chunked_iov(c->resp, it, it->nbytes - 2); in process_bin_get_or_touch()
545 if ((it->it_flags & ITEM_CHUNKED) == 0) { in process_bin_get_or_touch()
546 resp_add_iov(c->resp, ITEM_data(it), it->nbytes - 2); in process_bin_get_or_touch()
548 resp_add_chunked_iov(c->resp, it, it->nbytes - 2); in process_bin_get_or_touch()
557 if ((it->it_flags & ITEM_HDR) != 0 && should_return_value) { in process_bin_get_or_touch()
561 c->resp->item = it; in process_bin_get_or_touch()
564 c->resp->item = it; in process_bin_get_or_touch()
567 item_remove(it); in process_bin_get_or_touch()
602 stats_prefix_record_get(key, nkey, NULL != it); in process_bin_get_or_touch()
749 item *it = item_alloc(key, nkey, 0, 0, vlen+2); in process_bin_sasl_auth() local
752 if (it == 0 || (it->it_flags & ITEM_CHUNKED)) { in process_bin_sasl_auth()
755 if (it) { in process_bin_sasl_auth()
756 do_item_remove(it); in process_bin_sasl_auth()
761 c->item = it; in process_bin_sasl_auth()
762 c->ritem = ITEM_data(it); in process_bin_sasl_auth()
1084 item *it; in process_bin_update() local
1119 it = item_alloc(key, nkey, req->message.body.flags, in process_bin_update()
1122 if (it == 0) { in process_bin_update()
1136 ITEM_clsid(it), c->sfd); in process_bin_update()
1141 it = item_get(key, nkey, c->thread, DONT_UPDATE); in process_bin_update()
1142 if (it) { in process_bin_update()
1143 item_unlink(it); in process_bin_update()
1144 STORAGE_delete(c->thread->storage, it); in process_bin_update()
1145 item_remove(it); in process_bin_update()
1154 ITEM_set_cas(it, c->binary_header.request.cas); in process_bin_update()
1170 if (ITEM_get_cas(it) != 0) { in process_bin_update()
1174 c->item = it; in process_bin_update()
1176 if (it->it_flags & ITEM_CHUNKED) { in process_bin_update()
1177 c->ritem = ITEM_schunk(it); in process_bin_update()
1179 c->ritem = ITEM_data(it); in process_bin_update()
1182 c->ritem = ITEM_data(it); in process_bin_update()
1193 item *it; in process_bin_append_prepend() local
1209 it = item_alloc(key, nkey, 0, 0, vlen+2); in process_bin_append_prepend()
1211 if (it == 0) { in process_bin_append_prepend()
1224 ITEM_set_cas(it, c->binary_header.request.cas); in process_bin_append_prepend()
1237 c->item = it; in process_bin_append_prepend()
1239 if (it->it_flags & ITEM_CHUNKED) { in process_bin_append_prepend()
1240 c->ritem = ITEM_schunk(it); in process_bin_append_prepend()
1242 c->ritem = ITEM_data(it); in process_bin_append_prepend()
1245 c->ritem = ITEM_data(it); in process_bin_append_prepend()
1283 item *it; in process_bin_delete() local
1303 it = item_get_locked(key, nkey, c->thread, DONT_UPDATE, &hv); in process_bin_delete()
1304 if (it) { in process_bin_delete()
1306 if (cas == 0 || cas == ITEM_get_cas(it)) { in process_bin_delete()
1307 MEMCACHED_COMMAND_DELETE(c->sfd, ITEM_key(it), it->nkey); in process_bin_delete()
1309 c->thread->stats.slab_stats[ITEM_clsid(it)].delete_hits++; in process_bin_delete()
1311 do_item_unlink(it, hv); in process_bin_delete()
1312 STORAGE_delete(c->thread->storage, it); in process_bin_delete()
1317 do_item_remove(it); /* release our reference */ in process_bin_delete()