ocf: add metadata callbacks
This patch adds callback for serializing spdk metadata stored in ocf cache devices. Signed-off-by: Piotr Pelplinski <piotr.pelplinski@intel.com> Change-Id: I856bac3d63c7172dd6c67361794159fa38812a78 Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/449300 Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com> Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
d6f0613d19
commit
fca402b0f2
@ -427,18 +427,41 @@ vbdev_ocf_ctx_cleaner_stop(ocf_cleaner_t c)
|
||||
vbdev_ocf_queue_put(priv->queue);
|
||||
}
|
||||
|
||||
static int vbdev_ocf_volume_updater_init(ocf_metadata_updater_t mu)
|
||||
static void
|
||||
vbdev_ocf_md_kick(void *ctx)
|
||||
{
|
||||
/* TODO [metadata]: implement with persistent metadata support */
|
||||
ocf_metadata_updater_t mu = ctx;
|
||||
ocf_cache_t cache = ocf_metadata_updater_get_cache(mu);
|
||||
|
||||
if (ocf_cache_is_running(cache)) {
|
||||
ocf_metadata_updater_run(mu);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
vbdev_ocf_volume_updater_init(ocf_metadata_updater_t mu)
|
||||
{
|
||||
struct spdk_thread *md_thread = spdk_get_thread();
|
||||
|
||||
ocf_metadata_updater_set_priv(mu, md_thread);
|
||||
|
||||
return 0;
|
||||
}
|
||||
static void vbdev_ocf_volume_updater_stop(ocf_metadata_updater_t mu)
|
||||
|
||||
static void
|
||||
vbdev_ocf_volume_updater_stop(ocf_metadata_updater_t mu)
|
||||
{
|
||||
/* TODO [metadata]: implement with persistent metadata support */
|
||||
|
||||
}
|
||||
static void vbdev_ocf_volume_updater_kick(ocf_metadata_updater_t mu)
|
||||
|
||||
static void
|
||||
vbdev_ocf_volume_updater_kick(ocf_metadata_updater_t mu)
|
||||
{
|
||||
/* TODO [metadata]: implement with persistent metadata support */
|
||||
struct spdk_thread *md_thread = ocf_metadata_updater_get_priv(mu);
|
||||
|
||||
/* We need to send message to updater thread because
|
||||
* kick can happen from any thread */
|
||||
spdk_thread_send_msg(md_thread, vbdev_ocf_md_kick, mu);
|
||||
}
|
||||
|
||||
/* This function is main way by which OCF communicates with user
|
||||
|
Loading…
Reference in New Issue
Block a user