Commit 5bc5f864 authored by Ben Walker's avatar Ben Walker
Browse files

nbd: Encapsulate spdk_event usage in subsystem module



Events are part of the SPDK event framework and should be
isolated inside lib/event.

Change-Id: I8e9a5250bcbb9dd891f98df3177a6b5370a65fe3
Signed-off-by: default avatarBen Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/424270


Tested-by: default avatarSPDK CI Jenkins <sys_sgci@intel.com>
Chandler-Test-Pool: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: default avatarShuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Reviewed-by: default avatarChangpeng Liu <changpeng.liu@intel.com>
parent bfc5b558
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -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
}
+9 −1
Original line number Diff line number Diff line
@@ -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);
+1 −2
Original line number Diff line number Diff line
@@ -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