Use config helpers in example

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2019-05-23 13:27:18 +02:00
parent 0526239baf
commit 0f9f90b0cb

View File

@ -104,16 +104,13 @@ int initialize_cache(ocf_ctx_t ctx, ocf_cache_t *cache)
context.error = &ret; context.error = &ret;
/* Cache configuration */ /* Cache configuration */
cache_cfg.backfill.max_queue_size = 65536; ocf_mngt_cache_config_set_default(&cache_cfg);
cache_cfg.backfill.queue_unblock_size = 60000;
cache_cfg.cache_line_size = ocf_cache_line_size_4;
cache_cfg.cache_mode = ocf_cache_mode_wt;
cache_cfg.metadata_volatile = true; cache_cfg.metadata_volatile = true;
cache_cfg.name = "cache1"; cache_cfg.name = "cache1";
/* Cache deivce (volume) configuration */ /* Cache deivce (volume) configuration */
ocf_mngt_cache_device_config_set_default(&device_cfg);
device_cfg.volume_type = VOL_TYPE; device_cfg.volume_type = VOL_TYPE;
device_cfg.cache_line_size = ocf_cache_line_size_4;
ret = ocf_uuid_set_str(&device_cfg.uuid, "cache"); ret = ocf_uuid_set_str(&device_cfg.uuid, "cache");
if (ret) if (ret)
return ret; return ret;
@ -210,8 +207,9 @@ int initialize_core(ocf_cache_t cache, ocf_core_t *core)
context.error = &ret; context.error = &ret;
/* Core configuration */ /* Core configuration */
core_cfg.volume_type = VOL_TYPE; ocf_mngt_core_config_set_default(&core_cfg);
core_cfg.name = "core1"; core_cfg.name = "core1";
core_cfg.volume_type = VOL_TYPE;
ret = ocf_uuid_set_str(&core_cfg.uuid, "core"); ret = ocf_uuid_set_str(&core_cfg.uuid, "core");
if (ret) if (ret)
return ret; return ret;