Skip to content

Commit

Permalink
core: move more storage functions to storage.c
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dormando committed Oct 30, 2020
1 parent df49d38 commit 416a7a1
Show file tree
Hide file tree
Showing 10 changed files with 671 additions and 572 deletions.
5 changes: 2 additions & 3 deletions crawler.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
#include "memcached.h"
#include "storage.h"
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/resource.h>
Expand Down Expand Up @@ -186,9 +187,7 @@ static void crawler_expired_eval(crawler_module_t *cm, item *search, uint32_t hv
#ifdef EXTSTORE
bool is_valid = true;
if (search->it_flags & ITEM_HDR) {
item_hdr *hdr = (item_hdr *)ITEM_data(search);
if (extstore_check(storage, hdr->page_id, hdr->page_version) != 0)
is_valid = false;
is_valid = storage_validate_item(storage, search);
}
#endif
if ((search->exptime != 0 && search->exptime < current_time)
Expand Down
2 changes: 1 addition & 1 deletion items.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#include "memcached.h"
#include "bipbuffer.h"
#include "slab_automove.h"
#ifdef EXTSTORE
#include "storage.h"
#ifdef EXTSTORE
#include "slab_automove_extstore.h"
#endif
#include <sys/stat.h>
Expand Down
13 changes: 0 additions & 13 deletions items.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,3 @@ void lru_maintainer_pause(void);
void lru_maintainer_resume(void);

void *lru_bump_buf_create(void);

#ifdef EXTSTORE
#define STORAGE_delete(e, it) \
do { \
if (it->it_flags & ITEM_HDR) { \
item_hdr *hdr = (item_hdr *)ITEM_data(it); \
extstore_delete(e, hdr->page_id, hdr->page_version, \
1, ITEM_ntotal(it)); \
} \
} while (0)
#else
#define STORAGE_delete(...)
#endif
Loading

0 comments on commit 416a7a1

Please sign in to comment.