summaryrefslogtreecommitdiff
path: root/storage.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2020-08-30 23:27:34 -0700
committerdormando <dormando@rydia.net>2020-10-30 15:50:12 -0700
commit1ca5cdce9d403b4130e35dc1c99c6a1ea15f946f (patch)
treed3db2b10a187dcb2b7f6b43086095d05e00c26fc /storage.h
parent0d4cd8af759ff29562cf17a91ed7f909f88f6e32 (diff)
downloadmemcached-1ca5cdce9d403b4130e35dc1c99c6a1ea15f946f.tar.gz
core: restructure IO queue callbacks
mc_resp is the proper owner of a pending IO once it's been initialized; release it during resp_finish(). Also adds a completion callback which runs on the submitted stack after returning to the worker thread but before the response is transmitted. allows re-queueing for pending IO if processing a response generates another pending IO. also allows a further refactor to run more extstore code on the worker thread instead of the IO threads. uses proper conn_io_queue state to describe connections waiting for pending IO's.
Diffstat (limited to 'storage.h')
-rw-r--r--storage.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/storage.h b/storage.h
index 05e420d..ca59102 100644
--- a/storage.h
+++ b/storage.h
@@ -11,18 +11,26 @@ void storage_delete(void *e, item *it);
#define STORAGE_delete(...)
#endif
+// API.
void storage_stats(ADD_STAT add_stats, conn *c);
void process_extstore_stats(ADD_STAT add_stats, conn *c);
bool storage_validate_item(void *e, item *it);
int storage_get_item(conn *c, item *it, mc_resp *resp);
-void storage_submit_cb(void *ctx, io_pending_t *pending);
-void storage_free_cb(void *ctx, io_pending_t *pending);
+
+// callbacks for the IO queue subsystem.
+void storage_submit_cb(void *ctx, void *stack);
+void storage_complete_cb(void *ctx, void *stack);
+void storage_finalize_cb(io_pending_t *pending);
+
+// Thread functions.
int start_storage_write_thread(void *arg);
void storage_write_pause(void);
void storage_write_resume(void);
int start_storage_compact_thread(void *arg);
void storage_compact_pause(void);
void storage_compact_resume(void);
+
+// Init functions.
struct extstore_conf_file *storage_conf_parse(char *arg, unsigned int page_size);
void *storage_init_config(struct settings *s);
int storage_read_config(void *conf, char **subopt);