From abe4c73f40e8b1300be23d797af421a2a253e24f Mon Sep 17 00:00:00 2001 From: Daniel Verkamp Date: Mon, 12 Mar 2018 16:49:49 -0700 Subject: [PATCH] io_channel: use spdk_poller_fn consistently There are two separate function pointer types declared in io_channel.h: spdk_thread_fn for cross-thread messages, and spdk_poller_fn for pollers. They currently have the same signature, but this will be changing in an upcoming patch, so we need to fix the poller-related functions to use the correct type (a few were using spdk_thread_fn by mistake). Change-Id: I0f0d8f1eea9905395125fc91e0355a49e65be99e Signed-off-by: Daniel Verkamp Reviewed-on: https://review.gerrithub.io/403598 Tested-by: SPDK Automated Test System Reviewed-by: Jim Harris Reviewed-by: Changpeng Liu Reviewed-by: Shuhei Matsumoto --- examples/bdev/fio_plugin/fio_plugin.c | 2 +- include/spdk/io_channel.h | 2 +- lib/event/reactor.c | 2 +- test/lib/ut_multithread.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/bdev/fio_plugin/fio_plugin.c b/examples/bdev/fio_plugin/fio_plugin.c index 424993df7..f0cfc8ad9 100644 --- a/examples/bdev/fio_plugin/fio_plugin.c +++ b/examples/bdev/fio_plugin/fio_plugin.c @@ -127,7 +127,7 @@ spdk_fio_bdev_init_done(void *cb_arg, int rc) static struct spdk_poller * spdk_fio_start_poller(void *thread_ctx, - spdk_thread_fn fn, + spdk_poller_fn fn, void *arg, uint64_t period_microseconds) { diff --git a/include/spdk/io_channel.h b/include/spdk/io_channel.h index 81e2402f8..60d4005e2 100644 --- a/include/spdk/io_channel.h +++ b/include/spdk/io_channel.h @@ -181,7 +181,7 @@ void spdk_for_each_thread(spdk_thread_fn fn, void *ctx, spdk_thread_fn cpl); * \return a pointer to the poller registered on the current thread on success * or NULL on failure. */ -struct spdk_poller *spdk_poller_register(spdk_thread_fn fn, +struct spdk_poller *spdk_poller_register(spdk_poller_fn fn, void *arg, uint64_t period_microseconds); diff --git a/lib/event/reactor.c b/lib/event/reactor.c index b49fc1101..92b893525 100644 --- a/lib/event/reactor.c +++ b/lib/event/reactor.c @@ -249,7 +249,7 @@ _spdk_poller_insert_timer(struct spdk_reactor *reactor, struct spdk_poller *poll static struct spdk_poller * _spdk_reactor_start_poller(void *thread_ctx, - spdk_thread_fn fn, + spdk_poller_fn fn, void *arg, uint64_t period_microseconds) { diff --git a/test/lib/ut_multithread.c b/test/lib/ut_multithread.c index 17d89d846..724186fdb 100644 --- a/test/lib/ut_multithread.c +++ b/test/lib/ut_multithread.c @@ -83,7 +83,7 @@ __send_msg(spdk_thread_fn fn, void *ctx, void *thread_ctx) } static struct spdk_poller * -__start_poller(void *thread_ctx, spdk_thread_fn fn, void *arg, uint64_t period_microseconds) +__start_poller(void *thread_ctx, spdk_poller_fn fn, void *arg, uint64_t period_microseconds) { struct ut_thread *thread = thread_ctx; struct ut_poller *poller = calloc(1, sizeof(struct ut_poller));