summaryrefslogtreecommitdiff
path: root/memcached.c
diff options
context:
space:
mode:
Diffstat (limited to 'memcached.c')
-rw-r--r--memcached.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/memcached.c b/memcached.c
index 8f15d8d..d1be82f 100644
--- a/memcached.c
+++ b/memcached.c
@@ -2242,9 +2242,9 @@ static void complete_nread(conn *c) {
*
* Returns the state of storage.
*/
-enum store_item_type do_store_item(item *it, int comm, conn *c) {
+enum store_item_type do_store_item(item *it, int comm, conn *c, const uint32_t hv) {
char *key = ITEM_key(it);
- item *old_it = do_item_get(key, it->nkey);
+ item *old_it = do_item_get(key, it->nkey, hv);
enum store_item_type stored = NOT_STORED;
item *new_it = NULL;
@@ -2274,7 +2274,7 @@ enum store_item_type do_store_item(item *it, int comm, conn *c) {
c->thread->stats.slab_stats[old_it->slabs_clsid].cas_hits++;
pthread_mutex_unlock(&c->thread->stats.mutex);
- item_replace(old_it, it);
+ item_replace(old_it, it, hv);
stored = STORED;
} else {
pthread_mutex_lock(&c->thread->stats.mutex);
@@ -2337,9 +2337,9 @@ enum store_item_type do_store_item(item *it, int comm, conn *c) {
if (stored == NOT_STORED) {
if (old_it != NULL)
- item_replace(old_it, it);
+ item_replace(old_it, it, hv);
else
- do_item_link(it);
+ do_item_link(it, hv);
c->cas = ITEM_get_cas(it);
@@ -3032,13 +3032,14 @@ static void process_arithmetic_command(conn *c, token_t *tokens, const size_t nt
*/
enum delta_result_type do_add_delta(conn *c, const char *key, const size_t nkey,
const bool incr, const int64_t delta,
- char *buf, uint64_t *cas) {
+ char *buf, uint64_t *cas,
+ const uint32_t hv) {
char *ptr;
uint64_t value;
int res;
item *it;
- it = do_item_get(key, nkey);
+ it = do_item_get(key, nkey, hv);
if (!it) {
return DELTA_ITEM_NOT_FOUND;
}
@@ -3086,7 +3087,7 @@ enum delta_result_type do_add_delta(conn *c, const char *key, const size_t nkey,
}
memcpy(ITEM_data(new_it), buf, res);
memcpy(ITEM_data(new_it) + res, "\r\n", 2);
- item_replace(it, new_it);
+ item_replace(it, new_it, hv);
// Overwrite the older item's CAS with our new CAS since we're
// returning the CAS of the old item below.
ITEM_set_cas(it, (settings.use_cas) ? ITEM_get_cas(new_it) : 0);