Merge pull request #26 from robertbaldyga/adapt-to-new-ocf-20190524
Adapt to new ocf 20190524
This commit is contained in:
commit
d773a81fa7
@ -394,7 +394,7 @@ int cas_initialize_context(void)
|
|||||||
struct blk_data data;
|
struct blk_data data;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = ocf_ctx_init(&cas_ctx, &ctx_cfg);
|
ret = ocf_ctx_create(&cas_ctx, &ctx_cfg);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -441,12 +441,12 @@ err_rpool:
|
|||||||
err_mpool:
|
err_mpool:
|
||||||
ocf_mpool_destroy(cas_bvec_pool);
|
ocf_mpool_destroy(cas_bvec_pool);
|
||||||
err_ctx:
|
err_ctx:
|
||||||
ocf_ctx_exit(cas_ctx);
|
ocf_ctx_put(cas_ctx);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int cas_cleanup_context(void)
|
void cas_cleanup_context(void)
|
||||||
{
|
{
|
||||||
block_dev_deinit();
|
block_dev_deinit();
|
||||||
atomic_dev_deinit();
|
atomic_dev_deinit();
|
||||||
@ -454,7 +454,7 @@ int cas_cleanup_context(void)
|
|||||||
ocf_mpool_destroy(cas_bvec_pool);
|
ocf_mpool_destroy(cas_bvec_pool);
|
||||||
cas_rpool_destroy(cas_bvec_pages_rpool, _cas_free_page_rpool, NULL);
|
cas_rpool_destroy(cas_bvec_pages_rpool, _cas_free_page_rpool, NULL);
|
||||||
|
|
||||||
return ocf_ctx_exit(cas_ctx);
|
ocf_ctx_put(cas_ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *** CONTEXT DATA HELPER FUNCTION *** */
|
/* *** CONTEXT DATA HELPER FUNCTION *** */
|
||||||
|
@ -74,6 +74,6 @@ void cas_ctx_data_free(ctx_data_t *ctx_data);
|
|||||||
void cas_ctx_data_secure_erase(ctx_data_t *ctx_data);
|
void cas_ctx_data_secure_erase(ctx_data_t *ctx_data);
|
||||||
|
|
||||||
int cas_initialize_context(void);
|
int cas_initialize_context(void);
|
||||||
int cas_cleanup_context(void);
|
void cas_cleanup_context(void);
|
||||||
|
|
||||||
#endif /* __CONTEXT_H__ */
|
#endif /* __CONTEXT_H__ */
|
||||||
|
@ -408,7 +408,6 @@ int cache_mng_prepare_core_cfg(struct ocf_mngt_core_config *cfg,
|
|||||||
cfg->uuid.data = cmd_info->core_path_name;
|
cfg->uuid.data = cmd_info->core_path_name;
|
||||||
cfg->uuid.size = strnlen(cmd_info->core_path_name, MAX_STR_LEN) + 1;
|
cfg->uuid.size = strnlen(cmd_info->core_path_name, MAX_STR_LEN) + 1;
|
||||||
cfg->core_id = cmd_info->core_id;
|
cfg->core_id = cmd_info->core_id;
|
||||||
cfg->cache_id = cmd_info->cache_id;
|
|
||||||
cfg->try_add = cmd_info->try_add;
|
cfg->try_add = cmd_info->try_add;
|
||||||
|
|
||||||
if (cas_upgrade_is_in_upgrade()) {
|
if (cas_upgrade_is_in_upgrade()) {
|
||||||
@ -519,7 +518,7 @@ static void _cache_mng_add_core_complete(ocf_cache_t cache,
|
|||||||
static void _cache_mng_remove_core_complete(void *priv, int error);
|
static void _cache_mng_remove_core_complete(void *priv, int error);
|
||||||
|
|
||||||
int cache_mng_add_core_to_cache(struct ocf_mngt_core_config *cfg,
|
int cache_mng_add_core_to_cache(struct ocf_mngt_core_config *cfg,
|
||||||
struct kcas_insert_core *cmd_info)
|
ocf_cache_id_t cache_id, struct kcas_insert_core *cmd_info)
|
||||||
{
|
{
|
||||||
struct _cache_mng_add_core_context add_context;
|
struct _cache_mng_add_core_context add_context;
|
||||||
struct _cache_mng_sync_context remove_context;
|
struct _cache_mng_sync_context remove_context;
|
||||||
@ -528,7 +527,7 @@ int cache_mng_add_core_to_cache(struct ocf_mngt_core_config *cfg,
|
|||||||
ocf_core_id_t core_id;
|
ocf_core_id_t core_id;
|
||||||
int result, remove_core_result;
|
int result, remove_core_result;
|
||||||
|
|
||||||
result = ocf_mngt_cache_get_by_id(cas_ctx, cfg->cache_id, &cache);
|
result = ocf_mngt_cache_get_by_id(cas_ctx, cache_id, &cache);
|
||||||
if (cfg->try_add && (result == -OCF_ERR_CACHE_NOT_EXIST)) {
|
if (cfg->try_add && (result == -OCF_ERR_CACHE_NOT_EXIST)) {
|
||||||
result = ocf_mngt_core_pool_add(cas_ctx, &cfg->uuid,
|
result = ocf_mngt_core_pool_add(cas_ctx, &cfg->uuid,
|
||||||
cfg->volume_type);
|
cfg->volume_type);
|
||||||
|
@ -21,7 +21,7 @@ int cache_mng_get_cleaning_param(ocf_cache_id_t cache_id, ocf_cleaning_t type,
|
|||||||
uint32_t param_id, uint32_t *param_value);
|
uint32_t param_id, uint32_t *param_value);
|
||||||
|
|
||||||
int cache_mng_add_core_to_cache(struct ocf_mngt_core_config *cfg,
|
int cache_mng_add_core_to_cache(struct ocf_mngt_core_config *cfg,
|
||||||
struct kcas_insert_core *cmd_info);
|
ocf_cache_id_t cache_id, struct kcas_insert_core *cmd_info);
|
||||||
|
|
||||||
int cache_mng_remove_core_from_cache(struct kcas_remove_core *cmd);
|
int cache_mng_remove_core_from_cache(struct kcas_remove_core *cmd);
|
||||||
|
|
||||||
|
@ -959,11 +959,11 @@ static int _cas_upgrade_restore_conf_core(struct cas_properties *cache_props,
|
|||||||
cfg.try_add = 0;
|
cfg.try_add = 0;
|
||||||
cfg.volume_type = BLOCK_DEVICE_VOLUME;
|
cfg.volume_type = BLOCK_DEVICE_VOLUME;
|
||||||
cfg.core_id = core_id_int;
|
cfg.core_id = core_id_int;
|
||||||
cfg.cache_id = ocf_cache_get_id(cache);
|
|
||||||
cfg.uuid.data = core_path;
|
cfg.uuid.data = core_path;
|
||||||
cfg.uuid.size = strnlen(core_path, MAX_STR_LEN) + 1;
|
cfg.uuid.size = strnlen(core_path, MAX_STR_LEN) + 1;
|
||||||
|
|
||||||
result = cache_mng_add_core_to_cache(&cfg, NULL);
|
result = cache_mng_add_core_to_cache(&cfg,
|
||||||
|
ocf_cache_get_id(cache), NULL);
|
||||||
if (result)
|
if (result)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,8 @@ long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd,
|
|||||||
if (retval)
|
if (retval)
|
||||||
RETURN_CMD_RESULT(cmd_info, arg, retval);
|
RETURN_CMD_RESULT(cmd_info, arg, retval);
|
||||||
|
|
||||||
retval = cache_mng_add_core_to_cache(&cfg, cmd_info);
|
retval = cache_mng_add_core_to_cache(&cfg, cmd_info->cache_id,
|
||||||
|
cmd_info);
|
||||||
|
|
||||||
RETURN_CMD_RESULT(cmd_info, arg, retval);
|
RETURN_CMD_RESULT(cmd_info, arg, retval);
|
||||||
}
|
}
|
||||||
|
2
ocf
2
ocf
@ -1 +1 @@
|
|||||||
Subproject commit 7165bc16c3f9c3c6efbd41138fbdf4cf8aaf6262
|
Subproject commit 93a06686a7e2285b674b760c6360a7577556b8c7
|
Loading…
Reference in New Issue
Block a user