diff --git a/include/spdk/nbd.h b/include/spdk/nbd.h index 584dd0652..d987c1c4b 100644 --- a/include/spdk/nbd.h +++ b/include/spdk/nbd.h @@ -81,9 +81,8 @@ void spdk_nbd_stop(struct spdk_nbd_disk *nbd); * Write NBD subsystem configuration into provided JSON context. * * \param w JSON write context - * \param done_ev call this event when done. */ -void spdk_nbd_write_config_json(struct spdk_json_write_ctx *w, struct spdk_event *done_ev); +void spdk_nbd_write_config_json(struct spdk_json_write_ctx *w); #ifdef __cplusplus } diff --git a/lib/event/subsystems/nbd/nbd.c b/lib/event/subsystems/nbd/nbd.c index 767364462..a943eb82f 100644 --- a/lib/event/subsystems/nbd/nbd.c +++ b/lib/event/subsystems/nbd/nbd.c @@ -54,12 +54,20 @@ spdk_nbd_subsystem_fini(void) spdk_subsystem_fini_next(); } +static void +spdk_nbd_subsystem_write_config_json(struct spdk_json_write_ctx *w, + struct spdk_event *done_ev) +{ + spdk_nbd_write_config_json(w); + spdk_event_call(done_ev); +} + static struct spdk_subsystem g_spdk_subsystem_nbd = { .name = "nbd", .init = spdk_nbd_subsystem_init, .fini = spdk_nbd_subsystem_fini, .config = NULL, - .write_config_json = spdk_nbd_write_config_json, + .write_config_json = spdk_nbd_subsystem_write_config_json, }; SPDK_SUBSYSTEM_REGISTER(g_spdk_subsystem_nbd); diff --git a/lib/nbd/nbd.c b/lib/nbd/nbd.c index ad635ff4d..fc7726a44 100644 --- a/lib/nbd/nbd.c +++ b/lib/nbd/nbd.c @@ -211,7 +211,7 @@ spdk_nbd_disk_get_bdev_name(struct spdk_nbd_disk *nbd) } void -spdk_nbd_write_config_json(struct spdk_json_write_ctx *w, struct spdk_event *done_ev) +spdk_nbd_write_config_json(struct spdk_json_write_ctx *w) { struct spdk_nbd_disk *nbd; @@ -231,7 +231,6 @@ spdk_nbd_write_config_json(struct spdk_json_write_ctx *w, struct spdk_event *don } spdk_json_write_array_end(w); - spdk_event_call(done_ev); } void