event: spdk_subsystem_config_json is no longer asynchronous

Nothing needed this to be asynchronous.

Change-Id: Ic67167d5c1214e832b77ab7fa44aa693026d868a
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/447115
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-05 14:18:44 -07:00
parent eefe8806a2
commit 880b8b8af3
3 changed files with 5 additions and 22 deletions

View File

@ -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 * 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 * error \c null is written to the JSON context.
* so caller need to pass event that subsystem will call when it finish writing
* configuration.
* *
* \param w JSON write context * \param w JSON write context
* \param subsystem the subsystem to query * \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, void spdk_subsystem_config_json(struct spdk_json_write_ctx *w, struct spdk_subsystem *subsystem);
struct spdk_event *done_ev);
void spdk_rpc_initialize(const char *listen_addr); void spdk_rpc_initialize(const char *listen_addr);
void spdk_rpc_finish(void); void spdk_rpc_finish(void);

View File

@ -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}, {"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 static void
spdk_rpc_get_subsystem_config(struct spdk_jsonrpc_request *request, spdk_rpc_get_subsystem_config(struct spdk_jsonrpc_request *request,
const struct spdk_json_val *params) 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 rpc_get_subsystem_config req = {};
struct spdk_json_write_ctx *w; struct spdk_json_write_ctx *w;
struct spdk_subsystem *subsystem; struct spdk_subsystem *subsystem;
struct spdk_event *ev;
if (spdk_json_decode_object(params, rpc_get_subsystem_config, if (spdk_json_decode_object(params, rpc_get_subsystem_config,
SPDK_COUNTOF(rpc_get_subsystem_config), &req)) { 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); w = spdk_jsonrpc_begin_result(request);
if (w) { if (w) {
ev = spdk_event_allocate(spdk_env_get_current_core(), rpc_get_subsystem_config_done, request, w); spdk_subsystem_config_json(w, subsystem);
spdk_subsystem_config_json(w, subsystem, ev); spdk_jsonrpc_end_result(request, w);
} }
} }

View File

@ -244,14 +244,11 @@ spdk_subsystem_config(FILE *fp)
} }
void void
spdk_subsystem_config_json(struct spdk_json_write_ctx *w, struct spdk_subsystem *subsystem, spdk_subsystem_config_json(struct spdk_json_write_ctx *w, struct spdk_subsystem *subsystem)
struct spdk_event *done_ev)
{ {
if (subsystem && subsystem->write_config_json) { if (subsystem && subsystem->write_config_json) {
subsystem->write_config_json(w); subsystem->write_config_json(w);
} else { } else {
spdk_json_write_null(w); spdk_json_write_null(w);
} }
spdk_event_call(done_ev);
} }