From 57493bfca4d16f19aa6d591d29f19f3d2ad160f8 Mon Sep 17 00:00:00 2001 From: dormando Date: Fri, 30 Jul 2021 15:06:05 -0700 Subject: core: io_queue_t flow mode instead of passing ownership of (io_queue_t)*q to the side thread, instead the ownership of IO objects are passed to the side thread, which are then individually returned. The worker thread runs return_cb() on each, determining when it's done with the response batch. this interface could use more explicit functions to make it more clear. Ownership of *q isn't actually "passed" anywhere, it's just used or not used depending on which return function the owner wants. --- storage.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'storage.h') diff --git a/storage.h b/storage.h index ca59102..9257c3f 100644 --- a/storage.h +++ b/storage.h @@ -18,9 +18,9 @@ bool storage_validate_item(void *e, item *it); int storage_get_item(conn *c, item *it, mc_resp *resp); // 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); +void storage_submit_cb(io_queue_t *q); +void storage_complete_cb(io_queue_t *q); +int storage_finalize_cb(io_pending_t *pending); // Thread functions. int start_storage_write_thread(void *arg); -- cgit v1.2.1