example: Add missing argument to volume_open() function

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2019-05-02 13:32:36 +02:00
parent 2719799e99
commit 34a0aeb680
2 changed files with 8 additions and 8 deletions

View File

@ -141,12 +141,14 @@ int initialize_cache(ocf_ctx_t ctx, ocf_cache_t *cache)
* or adding core object. * or adding core object.
*/ */
ret = ocf_queue_create(*cache, &cache_priv->mngt_queue, &queue_ops); ret = ocf_queue_create(*cache, &cache_priv->mngt_queue, &queue_ops);
if (ret) if (ret) {
goto err_cache; ocf_mngt_cache_stop(*cache, simple_complete, &context);
goto err_priv;
}
/* /*
* Assign management queue to cache. This has to be done before any * 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 * 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. * 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. */ /* Create queue which will be used for IO submission. */
ret = ocf_queue_create(*cache, &cache_priv->io_queue, &queue_ops); ret = ocf_queue_create(*cache, &cache_priv->io_queue, &queue_ops);
if (ret) { if (ret)
goto err_queue; goto err_cache;
}
/* Attach volume to cache */ /* Attach volume to cache */
ocf_mngt_cache_attach(*cache, &device_cfg, simple_complete, &context); 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: err_cache:
ocf_mngt_cache_stop(*cache, simple_complete, &context); ocf_mngt_cache_stop(*cache, simple_complete, &context);
err_queue:
ocf_queue_put(cache_priv->mngt_queue); ocf_queue_put(cache_priv->mngt_queue);
err_priv: err_priv:
free(cache_priv); free(cache_priv);

View File

@ -14,7 +14,7 @@
* In open() function we store uuid data as volume name (for debug messages) * In open() function we store uuid data as volume name (for debug messages)
* and allocate 200 MiB of memory to simulate backend storage device. * 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); const struct ocf_volume_uuid *uuid = ocf_volume_get_uuid(volume);
struct myvolume *myvolume = ocf_volume_get_priv(volume); struct myvolume *myvolume = ocf_volume_get_priv(volume);