diff --git a/example/simple/src/main.c b/example/simple/src/main.c index fd1a880..a63ebf7 100644 --- a/example/simple/src/main.c +++ b/example/simple/src/main.c @@ -141,12 +141,14 @@ int initialize_cache(ocf_ctx_t ctx, ocf_cache_t *cache) * or adding core object. */ ret = ocf_queue_create(*cache, &cache_priv->mngt_queue, &queue_ops); - if (ret) - goto err_cache; + if (ret) { + ocf_mngt_cache_stop(*cache, simple_complete, &context); + goto err_priv; + } /* * Assign management queue to cache. This has to be done before any - * other management operation. Management queue it treated specially, + * other management operation. Management queue is treated specially, * and it may not be used for submitting IO requests. It also will not * be put on the cache stop - we have to put it manually at the end. */ @@ -154,9 +156,8 @@ int initialize_cache(ocf_ctx_t ctx, ocf_cache_t *cache) /* Create queue which will be used for IO submission. */ ret = ocf_queue_create(*cache, &cache_priv->io_queue, &queue_ops); - if (ret) { - goto err_queue; - } + if (ret) + goto err_cache; /* Attach volume to cache */ ocf_mngt_cache_attach(*cache, &device_cfg, simple_complete, &context); @@ -167,7 +168,6 @@ int initialize_cache(ocf_ctx_t ctx, ocf_cache_t *cache) err_cache: ocf_mngt_cache_stop(*cache, simple_complete, &context); -err_queue: ocf_queue_put(cache_priv->mngt_queue); err_priv: free(cache_priv); diff --git a/example/simple/src/volume.c b/example/simple/src/volume.c index e406e91..a47ff35 100644 --- a/example/simple/src/volume.c +++ b/example/simple/src/volume.c @@ -14,7 +14,7 @@ * In open() function we store uuid data as volume name (for debug messages) * and allocate 200 MiB of memory to simulate backend storage device. */ -static int volume_open(ocf_volume_t volume) +static int volume_open(ocf_volume_t volume, void *volume_params) { const struct ocf_volume_uuid *uuid = ocf_volume_get_uuid(volume); struct myvolume *myvolume = ocf_volume_get_priv(volume);