event: spdk_app_start now takes spdk_msg_fn

This callback type takes 1 argument instead of 2.

Change-Id: Ic3710fafb2828f08fc064f7658849b3d20521092
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/446997
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
This commit is contained in:
Ben Walker 2019-03-04 13:52:59 -07:00
parent b3fc4e7b4b
commit deb8ee5c33
20 changed files with 38 additions and 36 deletions

View File

@ -63,7 +63,7 @@ iscsi_usage(void)
} }
static void static void
spdk_startup(void *arg1, void *arg2) spdk_startup(void *arg1)
{ {
if (getenv("MEMZONE_DUMP") != NULL) { if (getenv("MEMZONE_DUMP") != NULL) {
spdk_memzone_dump(stdout); spdk_memzone_dump(stdout);

View File

@ -48,7 +48,7 @@ nvmf_parse_arg(int ch, char *arg)
} }
static void static void
nvmf_tgt_started(void *arg1, void *arg2) nvmf_tgt_started(void *arg1)
{ {
if (getenv("MEMZONE_DUMP") != NULL) { if (getenv("MEMZONE_DUMP") != NULL) {
spdk_memzone_dump(stdout); spdk_memzone_dump(stdout);

View File

@ -96,7 +96,7 @@ spdk_tgt_parse_arg(int ch, char *arg)
} }
static void static void
spdk_tgt_started(void *arg1, void *arg2) spdk_tgt_started(void *arg1)
{ {
if (g_pid_path) { if (g_pid_path) {
spdk_tgt_save_pid(g_pid_path); spdk_tgt_save_pid(g_pid_path);

View File

@ -79,7 +79,7 @@ vhost_parse_arg(int ch, char *arg)
} }
static void static void
vhost_started(void *arg1, void *arg2) vhost_started(void *arg1)
{ {
} }

View File

@ -188,7 +188,7 @@ hello_write(void *arg)
* Our initial event that kicks off everything from main(). * Our initial event that kicks off everything from main().
*/ */
static void static void
hello_start(void *arg1, void *arg2) hello_start(void *arg1)
{ {
struct hello_context_t *hello_context = arg1; struct hello_context_t *hello_context = arg1;
uint32_t blk_size, buf_align; uint32_t blk_size, buf_align;

View File

@ -49,7 +49,7 @@
* include it here. * include it here.
*/ */
#include "../lib/blob/blobstore.h" #include "../lib/blob/blobstore.h"
static void cli_start(void *arg1, void *arg2); static void cli_start(void *arg1);
static const char *program_name = "blobcli"; static const char *program_name = "blobcli";
/* default name for .conf file, any name can be used however with -c switch */ /* default name for .conf file, any name can be used however with -c switch */
@ -233,7 +233,7 @@ unload_complete(void *cb_arg, int bserrno)
/* when action is CLI_NONE, we know we need to remain in the shell */ /* when action is CLI_NONE, we know we need to remain in the shell */
cli_context->bs = NULL; cli_context->bs = NULL;
cli_context->action = CLI_NONE; cli_context->action = CLI_NONE;
cli_start(cli_context, NULL); cli_start(cli_context);
} }
} }
@ -912,7 +912,7 @@ list_bdevs(struct cli_context_t *cli_context)
spdk_app_stop(0); spdk_app_stop(0);
} else { } else {
cli_context->action = CLI_NONE; cli_context->action = CLI_NONE;
cli_start(cli_context, NULL); cli_start(cli_context);
} }
} }
@ -973,7 +973,7 @@ spdk_bsdump_done(void *arg, int bserrno)
spdk_app_stop(0); spdk_app_stop(0);
} else { } else {
cli_context->action = CLI_NONE; cli_context->action = CLI_NONE;
cli_start(cli_context, NULL); cli_start(cli_context);
} }
} }
@ -1424,7 +1424,7 @@ cli_shell(void *arg1, void *arg2)
* called first. * called first.
*/ */
static void static void
cli_start(void *arg1, void *arg2) cli_start(void *arg1)
{ {
struct cli_context_t *cli_context = arg1; struct cli_context_t *cli_context = arg1;

View File

@ -395,7 +395,7 @@ bs_init_complete(void *cb_arg, struct spdk_blob_store *bs,
* Our initial event that kicks off everything from main(). * Our initial event that kicks off everything from main().
*/ */
static void static void
hello_start(void *arg1, void *arg2) hello_start(void *arg1)
{ {
struct hello_context_t *hello_context = arg1; struct hello_context_t *hello_context = arg1;
struct spdk_bdev *bdev = NULL; struct spdk_bdev *bdev = NULL;

View File

@ -407,7 +407,7 @@ hello_start(void *arg1, int rc)
} }
static void static void
start_net_framework(void *arg1, void *arg2) start_net_framework(void *arg1)
{ {
spdk_net_framework_start(hello_start, arg1); spdk_net_framework_start(hello_start, arg1);
} }

View File

@ -46,6 +46,7 @@
#include "spdk/cpuset.h" #include "spdk/cpuset.h"
#include "spdk/queue.h" #include "spdk/queue.h"
#include "spdk/log.h" #include "spdk/log.h"
#include "spdk/thread.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -140,21 +141,23 @@ void spdk_app_opts_init(struct spdk_app_opts *opts);
/** /**
* Start the framework. * Start the framework.
* *
* Before calling this function, the fields of opts must be initialized by * Before calling this function, opts must be initialized by
* spdk_app_opts_init(). Once started, the framework will call start_fn on the * spdk_app_opts_init(). Once started, the framework will call start_fn on
* master core with the arguments provided. This call will block until spdk_app_stop() * an spdk_thread running on the current system thread with the
* is called, or if an error condition occurs during the intialization * argument provided. This call will block until spdk_app_stop()
* code within spdk_app_start(), itself, before invoking the caller's * is called. If an error condition occurs during the intialization
* supplied function. * code within spdk_app_start(), this function will immediately return
* before invoking start_fn.
* *
* \param opts Initialization options used for this application. * \param opts Initialization options used for this application.
* \param start_fn Event function that is called when the framework starts. * \param start_fn Entry point that will execute on an internally created thread
* \param arg1 Argument passed to function start_fn. * once the framework has been started.
* \param ctx Argument passed to function start_fn.
* *
* \return 0 on success or non-zero on failure. * \return 0 on success or non-zero on failure.
*/ */
int spdk_app_start(struct spdk_app_opts *opts, spdk_event_fn start_fn, int spdk_app_start(struct spdk_app_opts *opts, spdk_msg_fn start_fn,
void *arg1); void *ctx);
/** /**
* Perform final shutdown operations on an application using the event framework. * Perform final shutdown operations on an application using the event framework.

View File

@ -67,7 +67,7 @@ struct spdk_app {
}; };
static struct spdk_app g_spdk_app; static struct spdk_app g_spdk_app;
static spdk_event_fn g_start_fn = NULL; static spdk_msg_fn g_start_fn = NULL;
static void *g_start_arg = NULL; static void *g_start_arg = NULL;
static struct spdk_event *g_shutdown_event = NULL; static struct spdk_event *g_shutdown_event = NULL;
static uint32_t g_init_lcore; static uint32_t g_init_lcore;
@ -352,7 +352,7 @@ spdk_app_start_application(void)
assert(spdk_env_get_current_core() == g_init_lcore); assert(spdk_env_get_current_core() == g_init_lcore);
g_start_fn(g_start_arg, NULL); g_start_fn(g_start_arg);
} }
static void static void
@ -574,7 +574,7 @@ bootstrap_fn(void *arg1, void *arg2)
} }
int int
spdk_app_start(struct spdk_app_opts *opts, spdk_event_fn start_fn, spdk_app_start(struct spdk_app_opts *opts, spdk_msg_fn start_fn,
void *arg1) void *arg1)
{ {
struct spdk_conf *config = NULL; struct spdk_conf *config = NULL;

View File

@ -623,8 +623,7 @@ fs_load_cb(__attribute__((unused)) void *ctx,
} }
static void static void
spdk_rocksdb_run(__attribute__((unused)) void *arg1, spdk_rocksdb_run(__attribute__((unused)) void *arg1)
__attribute__((unused)) void *arg2)
{ {
struct spdk_bdev *bdev; struct spdk_bdev *bdev;

View File

@ -51,7 +51,7 @@ bdev_svc_parse_arg(int ch, char *arg)
} }
static void static void
bdev_svc_start(void *arg1, void *arg2) bdev_svc_start(void *arg1)
{ {
int fd; int fd;
int shm_id = (intptr_t)arg1; int shm_id = (intptr_t)arg1;

View File

@ -80,7 +80,7 @@ stub_sleep(void *arg)
} }
static void static void
stub_start(void *arg1, void *arg2) stub_start(void *arg1)
{ {
int shm_id = (intptr_t)arg1; int shm_id = (intptr_t)arg1;

View File

@ -912,7 +912,7 @@ __run_ut_thread(void *arg1, void *arg2)
} }
static void static void
test_main(void *arg1, void *arg2) test_main(void *arg1)
{ {
struct spdk_event *event; struct spdk_event *event;

View File

@ -862,7 +862,7 @@ ret:
} }
static void static void
bdevperf_run(void *arg1, void *arg2) bdevperf_run(void *arg1)
{ {
uint32_t i; uint32_t i;
struct io_target *target; struct io_target *target;

View File

@ -298,7 +298,7 @@ init_cb(void *ctx, struct spdk_filesystem *fs, int fserrno)
} }
static void static void
spdk_fuse_run(void *arg1, void *arg2) spdk_fuse_run(void *arg1)
{ {
construct_targets(); construct_targets();
spdk_fs_load(g_bs_dev, __send_request, init_cb, NULL); spdk_fs_load(g_bs_dev, __send_request, init_cb, NULL);

View File

@ -69,7 +69,7 @@ init_cb(void *ctx, struct spdk_filesystem *fs, int fserrno)
} }
static void static void
spdk_mkfs_run(void *arg1, void *arg2) spdk_mkfs_run(void *arg1)
{ {
struct spdk_bdev *bdev; struct spdk_bdev *bdev;
struct spdk_blobfs_opts blobfs_opt; struct spdk_blobfs_opts blobfs_opt;

View File

@ -85,7 +85,7 @@ event_work_fn(void *arg1, void *arg2)
} }
static void static void
event_perf_start(void *arg1, void *arg2) event_perf_start(void *arg1)
{ {
uint32_t i; uint32_t i;

View File

@ -85,7 +85,7 @@ nop(void *arg)
} }
static void static void
test_start(void *arg1, void *arg2) test_start(void *arg1)
{ {
printf("test_start\n"); printf("test_start\n");

View File

@ -64,7 +64,7 @@ __submit_next(void *arg1, void *arg2)
} }
static void static void
test_start(void *arg1, void *arg2) test_start(void *arg1)
{ {
int i; int i;