Lines Matching refs:it

54 bool storage_validate_item(void *e, item *it) {  in storage_validate_item()  argument
55 item_hdr *hdr = (item_hdr *)ITEM_data(it); in storage_validate_item()
63 void storage_delete(void *e, item *it) { in storage_delete() argument
64 if (it->it_flags & ITEM_HDR) { in storage_delete()
65 item_hdr *hdr = (item_hdr *)ITEM_data(it); in storage_delete()
67 1, ITEM_ntotal(it)); in storage_delete()
249 int storage_get_item(conn *c, item *it, mc_resp *resp) { in storage_get_item() argument
252 memcpy(&hdr, ITEM_data(it), sizeof(hdr)); in storage_get_item()
254 item_hdr *hdr = (item_hdr *)ITEM_data(it); in storage_get_item()
257 size_t ntotal = ITEM_ntotal(it); in storage_get_item()
264 FLAGS_CONV(it, flags); in storage_get_item()
265 new_it = item_alloc(ITEM_key(it), it->nkey, flags, it->exptime, it->nbytes); in storage_get_item()
288 p->hdr_it = it; in storage_get_item()
337 int iovtotal = (c->protocol == binary_prot) ? it->nbytes - 2 : it->nbytes; in storage_get_item()
400 item *it = (item *)io->buf; in recache_or_free() local
408 slabs_free(it, ntotal, slabs_clsid(ntotal)); in recache_or_free()
421 slabs_free(it, ntotal, slabs_clsid(ntotal)); in recache_or_free()
429 uint32_t hv = (uint32_t)it->time; in recache_or_free()
441 it->exptime = h_it->exptime; in recache_or_free()
442 it->it_flags &= ~ITEM_LINKED; in recache_or_free()
443 it->refcount = 0; in recache_or_free()
444 it->h_next = NULL; // might not be necessary. in recache_or_free()
446 item_replace(h_it, it, hv, ITEM_get_cas(h_it)); in recache_or_free()
456 slabs_free(it, ITEM_ntotal(it), ITEM_clsid(it)); in recache_or_free()
496 it_info.it = NULL; in storage_write()
499 if (it_info.it == NULL) { in storage_write()
504 item *it = it_info.it; in storage_write() local
506 size_t orig_ntotal = ITEM_ntotal(it); in storage_write()
508 if ((it->it_flags & ITEM_HDR) == 0 && in storage_write()
509 (item_age == 0 || current_time - it->time > item_age)) { in storage_write()
510 FLAGS_CONV(it, flags); in storage_write()
511 item *hdr_it = do_item_alloc(ITEM_key(it), it->nkey, flags, it->exptime, sizeof(item_hdr)); in storage_write()
516 int bucket = (it->it_flags & ITEM_CHUNKED) ? in storage_write()
519 if (it->exptime - current_time < settings.ext_low_ttl) { in storage_write()
527 assert(it->refcount >= 2); in storage_write()
537 if (it->it_flags & ITEM_CHUNKED) { in storage_write()
539 item_chunk *sch = (item_chunk *) ITEM_schunk(it); in storage_write()
543 int hdrtotal = ITEM_ntotal(it) - it->nbytes; in storage_write()
544 … memcpy((char *)io.buf+STORE_OFFSET, (char *)it+STORE_OFFSET, hdrtotal - STORE_OFFSET); in storage_write()
556 … memcpy((char *)io.buf+STORE_OFFSET, (char *)it+STORE_OFFSET, io.len-STORE_OFFSET); in storage_write()
567 hdr_it->nbytes = it->nbytes; in storage_write()
572 item_replace(it, hdr_it, it_info.hv, ITEM_get_cas(it)); in storage_write()
575 LOGGER_LOG(NULL, LOG_EVICTIONS, LOGGER_EXTSTORE_WRITE, it, bucket); in storage_write()
582 do_item_remove(it); in storage_write()
915 item *it = (item *)(readback_buf+offset); in storage_compact_readback() local
918 if (it->nkey == 0) { in storage_compact_readback()
922 ntotal = ITEM_ntotal(it); in storage_compact_readback()
923 uint32_t hv = (uint32_t)it->time; in storage_compact_readback()
926 hdr_it = assoc_find(ITEM_key(it), it->nkey, hv); in storage_compact_readback()
962 memcpy(io.buf, it, io.len); in storage_compact_readback()
973 if (it->refcount == 2) { in storage_compact_readback()