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:
parent
eefe8806a2
commit
880b8b8af3
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user