Removed starting cache from load

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
This commit is contained in:
Michal Mielewczyk 2019-02-20 17:05:39 -05:00
parent bdcdd57cf5
commit 1771228a46

View File

@ -1635,35 +1635,17 @@ static void _ocf_mngt_cache_load_log(ocf_cache_t cache)
} }
int ocf_mngt_cache_load(ocf_ctx_t ctx, ocf_cache_t *cache, int ocf_mngt_cache_load(ocf_ctx_t ctx, ocf_cache_t *cache,
struct ocf_mngt_cache_config *cfg,
struct ocf_mngt_cache_device_config *device_cfg) struct ocf_mngt_cache_device_config *device_cfg)
{ {
int result; int result;
if (!ctx || !cache || !cfg || !device_cfg) if (!ctx || !cache || !device_cfg)
return -OCF_ERR_INVAL; return -OCF_ERR_INVAL;
result = _ocf_mngt_cache_validate_cfg(cfg);
if (result)
return result;
result = _ocf_mngt_cache_validate_device_cfg(device_cfg); result = _ocf_mngt_cache_validate_device_cfg(device_cfg);
if (result) if (result)
return result; return result;
result = _ocf_mngt_cache_start(ctx, cache, cfg);
if (!result) {
ocf_cache_log(*cache, log_info, "Successfully added\n");
} else {
if (cfg->name) {
ocf_log(ctx, log_err, "Inserting cache %s failed\n",
cfg->name);
} else {
ocf_log(ctx, log_err, "Inserting cache failed\n");
}
return result;
}
result = _ocf_mngt_cache_attach(*cache, device_cfg, true); result = _ocf_mngt_cache_attach(*cache, device_cfg, true);
if (result) { if (result) {
_ocf_mngt_init_handle_error(*cache, ctx, NULL); _ocf_mngt_init_handle_error(*cache, ctx, NULL);