summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--items.c3
-rw-r--r--memcached.c8
-rw-r--r--memcached.h4
3 files changed, 13 insertions, 2 deletions
diff --git a/items.c b/items.c
index 5153420..400048b 100644
--- a/items.c
+++ b/items.c
@@ -1106,6 +1106,7 @@ int lru_pull_tail(const int orig_id, const int cur_lru,
itemstats[id].tailrepairs++;
search->refcount = 1;
/* This will call item_remove -> item_free since refcnt is 1 */
+ STORAGE_delete(ext_storage, search);
do_item_unlink_nolock(search, hv);
item_trylock_unlock(hold_lock);
continue;
@@ -1121,6 +1122,7 @@ int lru_pull_tail(const int orig_id, const int cur_lru,
}
/* refcnt 2 -> 1 */
do_item_unlink_nolock(search, hv);
+ STORAGE_delete(ext_storage, search);
/* refcnt 1 -> 0 -> item_free */
do_item_remove(search);
item_trylock_unlock(hold_lock);
@@ -1186,6 +1188,7 @@ int lru_pull_tail(const int orig_id, const int cur_lru,
itemstats[id].evicted_active++;
}
LOGGER_LOG(NULL, LOG_EVICTIONS, LOGGER_EVICTION, search);
+ STORAGE_delete(ext_storage, search);
do_item_unlink_nolock(search, hv);
removed++;
if (settings.slab_automove == 2) {
diff --git a/memcached.c b/memcached.c
index ddae1a1..1f1ff92 100644
--- a/memcached.c
+++ b/memcached.c
@@ -128,7 +128,12 @@ conn **conns;
struct slab_rebalance slab_rebal;
volatile int slab_rebalance_signal;
-
+#ifdef EXTSTORE
+/* hoping this is temporary; I'd prefer to cut globals, but will complete this
+ * battle another day.
+ */
+void *ext_storage;
+#endif
/** file scope variables **/
static conn *listen_conn = NULL;
static int max_fds;
@@ -7548,6 +7553,7 @@ int main (int argc, char **argv) {
fprintf(stderr, "Failed to initialize external storage\n");
exit(EXIT_FAILURE);
}
+ ext_storage = storage;
}
#endif
/*
diff --git a/memcached.h b/memcached.h
index b3e6e54..98c45d7 100644
--- a/memcached.h
+++ b/memcached.h
@@ -671,7 +671,9 @@ struct slab_rebalance {
};
extern struct slab_rebalance slab_rebal;
-
+#ifdef EXTSTORE
+extern void *ext_storage;
+#endif
/*
* Functions
*/