From 880b8b8af39f55e37c70d29ab595b65a0bc58c96 Mon Sep 17 00:00:00 2001 From: Ben Walker Date: Tue, 5 Mar 2019 14:18:44 -0700 Subject: [PATCH] event: spdk_subsystem_config_json is no longer asynchronous Nothing needed this to be asynchronous. Change-Id: Ic67167d5c1214e832b77ab7fa44aa693026d868a Signed-off-by: Ben Walker Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447115 Tested-by: SPDK CI Jenkins Reviewed-by: Jim Harris Reviewed-by: Shuhei Matsumoto --- include/spdk_internal/event.h | 8 ++------ lib/event/rpc/subsystem_rpc.c | 14 ++------------ lib/event/subsystem.c | 5 +---- 3 files changed, 5 insertions(+), 22 deletions(-) diff --git a/include/spdk_internal/event.h b/include/spdk_internal/event.h index 39c42e2eb..5d343781a 100644 --- a/include/spdk_internal/event.h +++ b/include/spdk_internal/event.h @@ -94,16 +94,12 @@ void spdk_subsystem_config(FILE *fp); /** * Save pointed \c subsystem configuration to the JSON write context \c w. In case of - * error \c null is written to the JSON context. Writing might be done in async way - * so caller need to pass event that subsystem will call when it finish writing - * configuration. + * error \c null is written to the JSON context. * * \param w JSON write context * \param subsystem the subsystem to query - * \param done_ev event to be called when writing is done */ -void spdk_subsystem_config_json(struct spdk_json_write_ctx *w, struct spdk_subsystem *subsystem, - struct spdk_event *done_ev); +void spdk_subsystem_config_json(struct spdk_json_write_ctx *w, struct spdk_subsystem *subsystem); void spdk_rpc_initialize(const char *listen_addr); void spdk_rpc_finish(void); diff --git a/lib/event/rpc/subsystem_rpc.c b/lib/event/rpc/subsystem_rpc.c index 1b83990f1..92cbab171 100644 --- a/lib/event/rpc/subsystem_rpc.c +++ b/lib/event/rpc/subsystem_rpc.c @@ -85,15 +85,6 @@ static const struct spdk_json_object_decoder rpc_get_subsystem_config[] = { {"name", offsetof(struct rpc_get_subsystem_config, name), spdk_json_decode_string}, }; -static void -rpc_get_subsystem_config_done(void *arg1, void *arg2) -{ - struct spdk_jsonrpc_request *request = arg1; - struct spdk_json_write_ctx *w = arg2; - - spdk_jsonrpc_end_result(request, w); -} - static void spdk_rpc_get_subsystem_config(struct spdk_jsonrpc_request *request, const struct spdk_json_val *params) @@ -101,7 +92,6 @@ spdk_rpc_get_subsystem_config(struct spdk_jsonrpc_request *request, struct rpc_get_subsystem_config req = {}; struct spdk_json_write_ctx *w; struct spdk_subsystem *subsystem; - struct spdk_event *ev; if (spdk_json_decode_object(params, rpc_get_subsystem_config, SPDK_COUNTOF(rpc_get_subsystem_config), &req)) { @@ -121,8 +111,8 @@ spdk_rpc_get_subsystem_config(struct spdk_jsonrpc_request *request, w = spdk_jsonrpc_begin_result(request); if (w) { - ev = spdk_event_allocate(spdk_env_get_current_core(), rpc_get_subsystem_config_done, request, w); - spdk_subsystem_config_json(w, subsystem, ev); + spdk_subsystem_config_json(w, subsystem); + spdk_jsonrpc_end_result(request, w); } } diff --git a/lib/event/subsystem.c b/lib/event/subsystem.c index c33a9b2e2..ccd10287d 100644 --- a/lib/event/subsystem.c +++ b/lib/event/subsystem.c @@ -244,14 +244,11 @@ spdk_subsystem_config(FILE *fp) } void -spdk_subsystem_config_json(struct spdk_json_write_ctx *w, struct spdk_subsystem *subsystem, - struct spdk_event *done_ev) +spdk_subsystem_config_json(struct spdk_json_write_ctx *w, struct spdk_subsystem *subsystem) { if (subsystem && subsystem->write_config_json) { subsystem->write_config_json(w); } else { spdk_json_write_null(w); } - - spdk_event_call(done_ev); }