From e5326570b34ad3171e8d685e6bd17b58928d06cd Mon Sep 17 00:00:00 2001 From: dormando Date: Sat, 29 Aug 2020 23:46:52 -0700 Subject: core: compile io_queue code by default don't gate on EXTSTORE for the deferred io_queue code. removes a number of ifdef's and allows more clean usage of the interface. --- memcached.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'memcached.h') diff --git a/memcached.h b/memcached.h index 08210f6..31687d8 100644 --- a/memcached.h +++ b/memcached.h @@ -611,8 +611,8 @@ typedef struct { struct conn_queue *new_conn_queue; /* queue of new connections to handle */ cache_t *rbuf_cache; /* static-sized read buffers */ mc_resp_bundle *open_bundle; -#ifdef EXTSTORE cache_t *io_cache; /* IO objects */ +#ifdef EXTSTORE void *storage; /* data object for storage system */ #endif logger *l; /* logger buffer */ @@ -665,7 +665,7 @@ struct _mc_resp_bundle { }; typedef struct conn conn; -#ifdef EXTSTORE + #define IO_QUEUE_NONE 0 #define IO_QUEUE_EXTSTORE 1 typedef struct _io_pending_t { @@ -690,7 +690,7 @@ typedef struct { io_queue_free_cb free_cb; int type; } io_queue_t; -#endif + /** * The structure representing a connection into memcached. */ @@ -736,11 +736,9 @@ struct conn { /* data for the swallow state */ int sbytes; /* how many bytes to swallow */ -#ifdef EXTSTORE - int io_pending; + int io_pending; /* number of deferred IO requests */ io_queue_t io_queues[3]; /* set of deferred IO queues. */ bool io_queued; /* IO's were queued. */ -#endif #ifdef EXTSTORE unsigned int recache_counter; #endif @@ -815,10 +813,8 @@ enum delta_result_type do_add_delta(conn *c, const char *key, uint64_t *cas, const uint32_t hv, item **it_ret); enum store_item_type do_store_item(item *item, int comm, conn* c, const uint32_t hv); -#ifdef EXTSTORE void conn_io_queue_add(conn *c, int type, void *ctx, io_queue_add_cb cb, io_queue_free_cb free_cb); io_queue_t *conn_io_queue_get(conn *c, int type); -#endif conn *conn_new(const int sfd, const enum conn_states init_state, const int event_flags, const int read_buffer_size, enum network_transport transport, struct event_base *base, void *ssl); -- cgit v1.2.1