Skip to content

Commit 416a7a1

Browse files
committed
core: move more storage functions to storage.c
extstore.h is now only used from storage.c. starting a path towards getting the storage interface to be more generalized. should be no functional changes.
1 parent df49d38 commit 416a7a1

File tree

10 files changed

+671
-572
lines changed

10 files changed

+671
-572
lines changed

crawler.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
88
#include "memcached.h"
9+
#include "storage.h"
910
#include <sys/stat.h>
1011
#include <sys/socket.h>
1112
#include <sys/resource.h>
@@ -186,9 +187,7 @@ static void crawler_expired_eval(crawler_module_t *cm, item *search, uint32_t hv
186187
#ifdef EXTSTORE
187188
bool is_valid = true;
188189
if (search->it_flags & ITEM_HDR) {
189-
item_hdr *hdr = (item_hdr *)ITEM_data(search);
190-
if (extstore_check(storage, hdr->page_id, hdr->page_version) != 0)
191-
is_valid = false;
190+
is_valid = storage_validate_item(storage, search);
192191
}
193192
#endif
194193
if ((search->exptime != 0 && search->exptime < current_time)

items.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
#include "memcached.h"
33
#include "bipbuffer.h"
44
#include "slab_automove.h"
5-
#ifdef EXTSTORE
65
#include "storage.h"
6+
#ifdef EXTSTORE
77
#include "slab_automove_extstore.h"
88
#endif
99
#include <sys/stat.h>

items.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,3 @@ void lru_maintainer_pause(void);
8484
void lru_maintainer_resume(void);
8585

8686
void *lru_bump_buf_create(void);
87-
88-
#ifdef EXTSTORE
89-
#define STORAGE_delete(e, it) \
90-
do { \
91-
if (it->it_flags & ITEM_HDR) { \
92-
item_hdr *hdr = (item_hdr *)ITEM_data(it); \
93-
extstore_delete(e, hdr->page_id, hdr->page_version, \
94-
1, ITEM_ntotal(it)); \
95-
} \
96-
} while (0)
97-
#else
98-
#define STORAGE_delete(...)
99-
#endif

0 commit comments

Comments
 (0)