Skip to content

Commit

Permalink
Merge pull request #26 from robertbaldyga/adapt-to-new-ocf-20190524
Browse files Browse the repository at this point in the history
Adapt to new ocf 20190524
  • Loading branch information
KamilLepek authored May 27, 2019
2 parents 068aadd + 00dae3b commit d773a81
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions modules/cas_cache/context.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ int cas_initialize_context(void)
struct blk_data data;
int ret;

ret = ocf_ctx_init(&cas_ctx, &ctx_cfg);
ret = ocf_ctx_create(&cas_ctx, &ctx_cfg);
if (ret < 0)
return ret;

Expand Down Expand Up @@ -441,20 +441,20 @@ int cas_initialize_context(void)
err_mpool:
ocf_mpool_destroy(cas_bvec_pool);
err_ctx:
ocf_ctx_exit(cas_ctx);
ocf_ctx_put(cas_ctx);

return ret;
}

int cas_cleanup_context(void)
void cas_cleanup_context(void)
{
block_dev_deinit();
atomic_dev_deinit();
cas_garbage_collector_deinit();
ocf_mpool_destroy(cas_bvec_pool);
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 *** */
Expand Down
2 changes: 1 addition & 1 deletion modules/cas_cache/context.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

int cas_initialize_context(void);
int cas_cleanup_context(void);
void cas_cleanup_context(void);

#endif /* __CONTEXT_H__ */
5 changes: 2 additions & 3 deletions modules/cas_cache/layer_cache_management.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.size = strnlen(cmd_info->core_path_name, MAX_STR_LEN) + 1;
cfg->core_id = cmd_info->core_id;
cfg->cache_id = cmd_info->cache_id;
cfg->try_add = cmd_info->try_add;

if (cas_upgrade_is_in_upgrade()) {
Expand Down Expand Up @@ -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);

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_sync_context remove_context;
Expand All @@ -528,7 +527,7 @@ int cache_mng_add_core_to_cache(struct ocf_mngt_core_config *cfg,
ocf_core_id_t core_id;
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)) {
result = ocf_mngt_core_pool_add(cas_ctx, &cfg->uuid,
cfg->volume_type);
Expand Down
2 changes: 1 addition & 1 deletion modules/cas_cache/layer_cache_management.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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);

Expand Down
4 changes: 2 additions & 2 deletions modules/cas_cache/layer_upgrade.c
Original file line number Diff line number Diff line change
Expand Up @@ -959,11 +959,11 @@ static int _cas_upgrade_restore_conf_core(struct cas_properties *cache_props,
cfg.try_add = 0;
cfg.volume_type = BLOCK_DEVICE_VOLUME;
cfg.core_id = core_id_int;
cfg.cache_id = ocf_cache_get_id(cache);
cfg.uuid.data = core_path;
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)
goto error;
}
Expand Down
3 changes: 2 additions & 1 deletion modules/cas_cache/service_ui_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ long cas_service_ioctl_ctrl(struct file *filp, unsigned int cmd,
if (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);
}
Expand Down
2 changes: 1 addition & 1 deletion ocf
Submodule ocf updated 52 files
+2 −2 doc/HOME.md
+12 −3 example/simple/src/ctx.c
+4 −6 example/simple/src/main.c
+10 −7 inc/ocf_ctx.h
+3 −0 inc/ocf_def.h
+114 −52 inc/ocf_mngt.h
+17 −19 src/engine/engine_bf.c
+10 −14 src/engine/engine_common.c
+2 −3 src/engine/engine_d2c.c
+1 −2 src/engine/engine_discard.c
+1 −2 src/engine/engine_fast.c
+1 −2 src/engine/engine_inv.c
+1 −1 src/engine/engine_ops.c
+3 −7 src/engine/engine_pt.c
+3 −5 src/engine/engine_rd.c
+3 −4 src/engine/engine_wa.c
+1 −2 src/engine/engine_wb.c
+4 −8 src/engine/engine_wi.c
+3 −5 src/engine/engine_wt.c
+1 −2 src/engine/engine_zero.c
+5 −5 src/eviction/eviction.c
+1 −1 src/eviction/eviction.h
+1 −1 src/eviction/lru.c
+1 −2 src/eviction/lru.h
+2 −5 src/eviction/ops.h
+2 −2 src/metadata/metadata.c
+4 −0 src/metadata/metadata_io.c
+4 −53 src/mngt/ocf_mngt_cache.c
+4 −0 src/mngt/ocf_mngt_common.c
+7 −3 src/mngt/ocf_mngt_core.c
+1 −5 src/mngt/ocf_mngt_io_class.c
+16 −10 src/ocf_ctx.c
+1 −0 src/ocf_ctx_priv.h
+3 −3 src/ocf_request.h
+13 −13 src/ocf_trace_priv.h
+4 −4 src/utils/utils_cache_line.c
+5 −5 src/utils/utils_cache_line.h
+3 −1 src/utils/utils_cleaner.c
+2 −5 src/utils/utils_io.c
+5 −4 src/utils/utils_part.c
+4 −4 src/utils/utils_req.c
+44 −22 tests/functional/pyocf/types/cache.py
+10 −5 tests/functional/pyocf/types/core.py
+2 −4 tests/functional/pyocf/types/ctx.py
+11 −10 tests/functional/pyocf/types/data.py
+23 −5 tests/functional/pyocf/types/volume.py
+21 −20 tests/functional/pyocf/utils.py
+0 −2 tests/functional/tests/basic/test_pyocf.py
+0 −31 tests/functional/tests/management/test_change_mode.py
+135 −0 tests/functional/tests/management/test_change_params.py
+24 −2 tests/functional/tests/management/test_start_stop.py
+32 −4 tests/unit/framework/run_unit_tests.py

0 comments on commit d773a81

Please sign in to comment.