Merge pull request #183 from mmichal10/mngt-functions-names-unification

Unified management functions prefix.
This commit is contained in:
Adam Rutkowski 2019-06-05 09:55:01 -04:00 committed by GitHub
commit ccdc6140b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 69 additions and 69 deletions

View File

@ -333,7 +333,7 @@ static void evp_lru_clean(ocf_cache_t cache, ocf_queue_t io_queue,
cnt = ocf_refcnt_inc(counter); cnt = ocf_refcnt_inc(counter);
if (!cnt) { if (!cnt) {
/* cleaner disabled by mngmt operation */ /* cleaner disabled by management operation */
return; return;
} }
if (cnt > 1) { if (cnt > 1) {

View File

@ -50,9 +50,9 @@ static ocf_cache_t _ocf_mngt_get_cache(ocf_ctx_t owner,
"Restart with --load or --force option\n" "Restart with --load or --force option\n"
/** /**
* @brief Helpful function to start cache * @brief Helpful struct to start cache
*/ */
struct ocf_cachemng_init_params { struct ocf_cache_mngt_init_params {
bool metadata_volatile; bool metadata_volatile;
ocf_cache_id_t id; ocf_cache_id_t id;
@ -541,7 +541,7 @@ static void _ocf_mngt_init_instance_load(
* @brief allocate memory for new cache, add it to cache queue, set initial * @brief allocate memory for new cache, add it to cache queue, set initial
* values and running state * values and running state
*/ */
static int _ocf_mngt_init_new_cache(struct ocf_cachemng_init_params *params) static int _ocf_mngt_init_new_cache(struct ocf_cache_mngt_init_params *params)
{ {
ocf_cache_t cache = env_vzalloc(sizeof(*cache)); ocf_cache_t cache = env_vzalloc(sizeof(*cache));
@ -642,7 +642,7 @@ static void _ocf_mngt_attach_cache_device(ocf_pipeline_t pipeline,
* @brief prepare cache for init. This is first step towards initializing * @brief prepare cache for init. This is first step towards initializing
* the cache * the cache
*/ */
static int _ocf_mngt_init_prepare_cache(struct ocf_cachemng_init_params *param, static int _ocf_mngt_init_prepare_cache(struct ocf_cache_mngt_init_params *param,
struct ocf_mngt_cache_config *cfg) struct ocf_mngt_cache_config *cfg)
{ {
ocf_cache_t cache; ocf_cache_t cache;
@ -1104,7 +1104,7 @@ int ocf_mngt_get_ram_needed(ocf_cache_t cache,
* *
*/ */
static void _ocf_mngt_init_handle_error(ocf_ctx_t ctx, static void _ocf_mngt_init_handle_error(ocf_ctx_t ctx,
struct ocf_cachemng_init_params *params) struct ocf_cache_mngt_init_params *params)
{ {
ocf_cache_t cache = params->cache; ocf_cache_t cache = params->cache;
@ -1150,7 +1150,7 @@ static void _ocf_mngt_attach_handle_error(
} }
static int _ocf_mngt_cache_init(ocf_cache_t cache, static int _ocf_mngt_cache_init(ocf_cache_t cache,
struct ocf_cachemng_init_params *params) struct ocf_cache_mngt_init_params *params)
{ {
int i; int i;
@ -1180,7 +1180,7 @@ static int _ocf_mngt_cache_init(ocf_cache_t cache,
static int _ocf_mngt_cache_start(ocf_ctx_t ctx, ocf_cache_t *cache, static int _ocf_mngt_cache_start(ocf_ctx_t ctx, ocf_cache_t *cache,
struct ocf_mngt_cache_config *cfg) struct ocf_mngt_cache_config *cfg)
{ {
struct ocf_cachemng_init_params params; struct ocf_cache_mngt_init_params params;
int result; int result;
ENV_BUG_ON(env_memset(&params, sizeof(params), 0)); ENV_BUG_ON(env_memset(&params, sizeof(params), 0));
@ -1197,7 +1197,7 @@ static int _ocf_mngt_cache_start(ocf_ctx_t ctx, ocf_cache_t *cache,
/* Prepare cache */ /* Prepare cache */
result = _ocf_mngt_init_prepare_cache(&params, cfg); result = _ocf_mngt_init_prepare_cache(&params, cfg);
if (result) if (result)
goto _cache_mng_init_instance_ERROR; goto _cache_mngt_init_instance_ERROR;
*cache = params.cache; *cache = params.cache;
@ -1207,7 +1207,7 @@ static int _ocf_mngt_cache_start(ocf_ctx_t ctx, ocf_cache_t *cache,
result = ocf_metadata_init(*cache, params.metadata.line_size); result = ocf_metadata_init(*cache, params.metadata.line_size);
if (result) { if (result) {
result = -OCF_ERR_START_CACHE_FAIL; result = -OCF_ERR_START_CACHE_FAIL;
goto _cache_mng_init_instance_ERROR; goto _cache_mngt_init_instance_ERROR;
} }
ocf_log(ctx, log_debug, "Metadata initialized\n"); ocf_log(ctx, log_debug, "Metadata initialized\n");
@ -1215,7 +1215,7 @@ static int _ocf_mngt_cache_start(ocf_ctx_t ctx, ocf_cache_t *cache,
result = _ocf_mngt_cache_init(*cache, &params); result = _ocf_mngt_cache_init(*cache, &params);
if (result) if (result)
goto _cache_mng_init_instance_ERROR; goto _cache_mngt_init_instance_ERROR;
ocf_ctx_get(ctx); ocf_ctx_get(ctx);
@ -1229,13 +1229,13 @@ static int _ocf_mngt_cache_start(ocf_ctx_t ctx, ocf_cache_t *cache,
return 0; return 0;
_cache_mng_init_instance_ERROR: _cache_mngt_init_instance_ERROR:
_ocf_mngt_init_handle_error(ctx, &params); _ocf_mngt_init_handle_error(ctx, &params);
*cache = NULL; *cache = NULL;
return result; return result;
} }
static void _ocf_mng_cache_set_valid(ocf_cache_t cache) static void _ocf_mngt_cache_set_valid(ocf_cache_t cache)
{ {
/* /*
* Clear initialization state and set the valid bit so we know * Clear initialization state and set the valid bit so we know
@ -1628,7 +1628,7 @@ int ocf_mngt_cache_start(ocf_ctx_t ctx, ocf_cache_t *cache,
result = _ocf_mngt_cache_start(ctx, cache, cfg); result = _ocf_mngt_cache_start(ctx, cache, cfg);
if (!result) { if (!result) {
_ocf_mng_cache_set_valid(*cache); _ocf_mngt_cache_set_valid(*cache);
ocf_cache_log(*cache, log_info, "Successfully added\n"); ocf_cache_log(*cache, log_info, "Successfully added\n");
ocf_cache_log(*cache, log_info, "Cache mode : %s\n", ocf_cache_log(*cache, log_info, "Cache mode : %s\n",
@ -1807,7 +1807,7 @@ static void _ocf_mngt_cache_load_complete(ocf_cache_t cache, void *priv1,
if (error) if (error)
OCF_CMPL_RET(cache, priv2, error); OCF_CMPL_RET(cache, priv2, error);
_ocf_mng_cache_set_valid(cache); _ocf_mngt_cache_set_valid(cache);
_ocf_mngt_cache_load_log(cache); _ocf_mngt_cache_load_log(cache);
OCF_CMPL_RET(cache, priv2, 0); OCF_CMPL_RET(cache, priv2, 0);
@ -1886,10 +1886,10 @@ static void ocf_mngt_cache_stop_remove_cores(ocf_pipeline_t pipeline,
/* All exported objects removed, cleaning up rest. */ /* All exported objects removed, cleaning up rest. */
for_each_core(cache, core, core_id) { for_each_core(cache, core, core_id) {
cache_mng_core_remove_from_cache(core); cache_mngt_core_remove_from_cache(core);
if (context->cache_attached) if (context->cache_attached)
cache_mng_core_remove_from_cleaning_pol(core); cache_mngt_core_remove_from_cleaning_pol(core);
cache_mng_core_close(core); cache_mngt_core_close(core);
if (--no == 0) if (--no == 0)
break; break;
} }
@ -2109,7 +2109,7 @@ void ocf_mngt_cache_save(ocf_cache_t cache,
ocf_mngt_cache_save_flush_sb_complete, context); ocf_mngt_cache_save_flush_sb_complete, context);
} }
static void _cache_mng_update_initial_dirty_clines(ocf_cache_t cache) static void _cache_mngt_update_initial_dirty_clines(ocf_cache_t cache)
{ {
ocf_core_t core; ocf_core_t core;
ocf_core_id_t core_id; ocf_core_id_t core_id;
@ -2122,7 +2122,7 @@ static void _cache_mng_update_initial_dirty_clines(ocf_cache_t cache)
} }
static int _cache_mng_set_cache_mode(ocf_cache_t cache, ocf_cache_mode_t mode) static int _cache_mngt_set_cache_mode(ocf_cache_t cache, ocf_cache_mode_t mode)
{ {
ocf_cache_mode_t mode_old = cache->conf_meta->cache_mode; ocf_cache_mode_t mode_old = cache->conf_meta->cache_mode;
@ -2139,7 +2139,7 @@ static int _cache_mng_set_cache_mode(ocf_cache_t cache, ocf_cache_mode_t mode)
cache->conf_meta->cache_mode = mode; cache->conf_meta->cache_mode = mode;
if (mode_old == ocf_cache_mode_wb) if (mode_old == ocf_cache_mode_wb)
_cache_mng_update_initial_dirty_clines(cache); _cache_mngt_update_initial_dirty_clines(cache);
ocf_cache_log(cache, log_info, "Changing cache mode from '%s' to '%s' " ocf_cache_log(cache, log_info, "Changing cache mode from '%s' to '%s' "
"successful\n", ocf_get_io_iface_name(mode_old), "successful\n", ocf_get_io_iface_name(mode_old),
@ -2160,7 +2160,7 @@ int ocf_mngt_cache_set_mode(ocf_cache_t cache, ocf_cache_mode_t mode)
return -OCF_ERR_INVAL; return -OCF_ERR_INVAL;
} }
result = _cache_mng_set_cache_mode(cache, mode); result = _cache_mngt_set_cache_mode(cache, mode);
if (result) { if (result) {
const char *name = ocf_get_io_iface_name(mode); const char *name = ocf_get_io_iface_name(mode);
@ -2304,8 +2304,8 @@ static void ocf_mngt_cache_detach_update_metadata(ocf_pipeline_t pipeline,
/* remove cacheline metadata and cleaning policy meta for all cores */ /* remove cacheline metadata and cleaning policy meta for all cores */
for_each_core(cache, core, core_id) { for_each_core(cache, core, core_id) {
cache_mng_core_deinit_attached_meta(core); cache_mngt_core_deinit_attached_meta(core);
cache_mng_core_remove_from_cleaning_pol(core); cache_mngt_core_remove_from_cleaning_pol(core);
if (--no == 0) if (--no == 0)
break; break;
} }

View File

@ -17,7 +17,7 @@
#include "../engine/engine_common.h" #include "../engine/engine_common.h"
/* Close if opened */ /* Close if opened */
int cache_mng_core_close(ocf_core_t core) int cache_mngt_core_close(ocf_core_t core)
{ {
if (!core->opened) if (!core->opened)
return -OCF_ERR_CORE_IN_INACTIVE_STATE; return -OCF_ERR_CORE_IN_INACTIVE_STATE;
@ -29,7 +29,7 @@ int cache_mng_core_close(ocf_core_t core)
} }
/* Remove core from cleaning policy */ /* Remove core from cleaning policy */
void cache_mng_core_remove_from_cleaning_pol(ocf_core_t core) void cache_mngt_core_remove_from_cleaning_pol(ocf_core_t core)
{ {
ocf_cache_t cache = ocf_core_get_cache(core); ocf_cache_t cache = ocf_core_get_cache(core);
ocf_core_id_t core_id = ocf_core_get_id(core); ocf_core_id_t core_id = ocf_core_get_id(core);
@ -49,7 +49,7 @@ void cache_mng_core_remove_from_cleaning_pol(ocf_core_t core)
} }
/* Deinitialize core metadata in attached metadata */ /* Deinitialize core metadata in attached metadata */
void cache_mng_core_deinit_attached_meta(ocf_core_t core) void cache_mngt_core_deinit_attached_meta(ocf_core_t core)
{ {
int retry = 1; int retry = 1;
uint64_t core_size = 0; uint64_t core_size = 0;
@ -88,7 +88,7 @@ void cache_mng_core_deinit_attached_meta(ocf_core_t core)
} }
/* Mark core as removed in metadata */ /* Mark core as removed in metadata */
void cache_mng_core_remove_from_meta(ocf_core_t core) void cache_mngt_core_remove_from_meta(ocf_core_t core)
{ {
ocf_cache_t cache = ocf_core_get_cache(core); ocf_cache_t cache = ocf_core_get_cache(core);
@ -105,7 +105,7 @@ void cache_mng_core_remove_from_meta(ocf_core_t core)
} }
/* Deinit in-memory structures related to this core */ /* Deinit in-memory structures related to this core */
void cache_mng_core_remove_from_cache(ocf_core_t core) void cache_mngt_core_remove_from_cache(ocf_core_t core)
{ {
ocf_cache_t cache = ocf_core_get_cache(core); ocf_cache_t cache = ocf_core_get_cache(core);
ocf_core_id_t core_id = ocf_core_get_id(core); ocf_core_id_t core_id = ocf_core_get_id(core);

View File

@ -7,19 +7,19 @@
#ifndef __OCF_MNGT_COMMON_H__ #ifndef __OCF_MNGT_COMMON_H__
#define __OCF_MNGT_COMMON_H__ #define __OCF_MNGT_COMMON_H__
int cache_mng_core_close(ocf_core_t core); int cache_mngt_core_close(ocf_core_t core);
void cache_mng_core_remove_from_meta(ocf_core_t core); void cache_mngt_core_remove_from_meta(ocf_core_t core);
void cache_mng_core_remove_from_cache(ocf_core_t core); void cache_mngt_core_remove_from_cache(ocf_core_t core);
void cache_mng_core_deinit_attached_meta(ocf_core_t core); void cache_mngt_core_deinit_attached_meta(ocf_core_t core);
void cache_mng_core_remove_from_cleaning_pol(ocf_core_t core); void cache_mngt_core_remove_from_cleaning_pol(ocf_core_t core);
int _ocf_cleaning_thread(void *priv); int _ocf_cleaning_thread(void *priv);
int cache_mng_thread_io_requests(void *data); int cache_mngt_thread_io_requests(void *data);
bool ocf_mngt_cache_is_dirty(ocf_cache_t cache); bool ocf_mngt_cache_is_dirty(ocf_cache_t cache);

View File

@ -663,12 +663,12 @@ static void _ocf_mngt_cache_remove_core(ocf_pipeline_t pipeline, void *priv,
/* Deinit everything*/ /* Deinit everything*/
if (ocf_cache_is_device_attached(cache)) { if (ocf_cache_is_device_attached(cache)) {
cache_mng_core_deinit_attached_meta(core); cache_mngt_core_deinit_attached_meta(core);
cache_mng_core_remove_from_cleaning_pol(core); cache_mngt_core_remove_from_cleaning_pol(core);
} }
cache_mng_core_remove_from_meta(core); cache_mngt_core_remove_from_meta(core);
cache_mng_core_remove_from_cache(core); cache_mngt_core_remove_from_cache(core);
cache_mng_core_close(core); cache_mngt_core_close(core);
/* Update super-block with core device removal */ /* Update super-block with core device removal */
ocf_metadata_flush_superblock(cache, ocf_metadata_flush_superblock(cache,
@ -758,7 +758,7 @@ static void _ocf_mngt_cache_detach_core(ocf_pipeline_t pipeline,
ocf_core_log(core, log_debug, "Detaching core\n"); ocf_core_log(core, log_debug, "Detaching core\n");
status = cache_mng_core_close(core); status = cache_mngt_core_close(core);
if (status) if (status)
OCF_PL_FINISH_RET(pipeline, status); OCF_PL_FINISH_RET(pipeline, status);
@ -912,7 +912,7 @@ int ocf_mngt_core_get_user_metadata(ocf_core_t core, void *data, size_t size)
return 0; return 0;
} }
static int _cache_mng_set_core_seq_cutoff_threshold(ocf_core_t core, void *cntx) static int _cache_mngt_set_core_seq_cutoff_threshold(ocf_core_t core, void *cntx)
{ {
uint32_t threshold = *(uint32_t*) cntx; uint32_t threshold = *(uint32_t*) cntx;
uint32_t threshold_old = core->conf_meta->seq_cutoff_threshold; uint32_t threshold_old = core->conf_meta->seq_cutoff_threshold;
@ -936,7 +936,7 @@ int ocf_mngt_core_set_seq_cutoff_threshold(ocf_core_t core, uint32_t thresh)
{ {
OCF_CHECK_NULL(core); OCF_CHECK_NULL(core);
return _cache_mng_set_core_seq_cutoff_threshold(core, &thresh); return _cache_mngt_set_core_seq_cutoff_threshold(core, &thresh);
} }
int ocf_mngt_core_set_seq_cutoff_threshold_all(ocf_cache_t cache, int ocf_mngt_core_set_seq_cutoff_threshold_all(ocf_cache_t cache,
@ -944,7 +944,7 @@ int ocf_mngt_core_set_seq_cutoff_threshold_all(ocf_cache_t cache,
{ {
OCF_CHECK_NULL(cache); OCF_CHECK_NULL(cache);
return ocf_core_visit(cache, _cache_mng_set_core_seq_cutoff_threshold, return ocf_core_visit(cache, _cache_mngt_set_core_seq_cutoff_threshold,
&thresh, true); &thresh, true);
} }
@ -964,7 +964,7 @@ static const char *_ocf_seq_cutoff_policy_names[ocf_seq_cutoff_policy_max] = {
[ocf_seq_cutoff_policy_never] = "never", [ocf_seq_cutoff_policy_never] = "never",
}; };
static const char *_cache_mng_seq_cutoff_policy_get_name( static const char *_cache_mngt_seq_cutoff_policy_get_name(
ocf_seq_cutoff_policy policy) ocf_seq_cutoff_policy policy)
{ {
if (policy < 0 || policy >= ocf_seq_cutoff_policy_max) if (policy < 0 || policy >= ocf_seq_cutoff_policy_max)
@ -973,7 +973,7 @@ static const char *_cache_mng_seq_cutoff_policy_get_name(
return _ocf_seq_cutoff_policy_names[policy]; return _ocf_seq_cutoff_policy_names[policy];
} }
static int _cache_mng_set_core_seq_cutoff_policy(ocf_core_t core, void *cntx) static int _cache_mngt_set_core_seq_cutoff_policy(ocf_core_t core, void *cntx)
{ {
ocf_seq_cutoff_policy policy = *(ocf_seq_cutoff_policy*) cntx; ocf_seq_cutoff_policy policy = *(ocf_seq_cutoff_policy*) cntx;
uint32_t policy_old = core->conf_meta->seq_cutoff_policy; uint32_t policy_old = core->conf_meta->seq_cutoff_policy;
@ -981,7 +981,7 @@ static int _cache_mng_set_core_seq_cutoff_policy(ocf_core_t core, void *cntx)
if (policy_old == policy) { if (policy_old == policy) {
ocf_core_log(core, log_info, ocf_core_log(core, log_info,
"Sequential cutoff policy %s is already set\n", "Sequential cutoff policy %s is already set\n",
_cache_mng_seq_cutoff_policy_get_name(policy)); _cache_mngt_seq_cutoff_policy_get_name(policy));
return 0; return 0;
} }
@ -995,8 +995,8 @@ static int _cache_mng_set_core_seq_cutoff_policy(ocf_core_t core, void *cntx)
ocf_core_log(core, log_info, ocf_core_log(core, log_info,
"Changing sequential cutoff policy from %s to %s\n", "Changing sequential cutoff policy from %s to %s\n",
_cache_mng_seq_cutoff_policy_get_name(policy_old), _cache_mngt_seq_cutoff_policy_get_name(policy_old),
_cache_mng_seq_cutoff_policy_get_name(policy)); _cache_mngt_seq_cutoff_policy_get_name(policy));
return 0; return 0;
} }
@ -1006,14 +1006,14 @@ int ocf_mngt_core_set_seq_cutoff_policy(ocf_core_t core,
{ {
OCF_CHECK_NULL(core); OCF_CHECK_NULL(core);
return _cache_mng_set_core_seq_cutoff_policy(core, &policy); return _cache_mngt_set_core_seq_cutoff_policy(core, &policy);
} }
int ocf_mngt_core_set_seq_cutoff_policy_all(ocf_cache_t cache, int ocf_mngt_core_set_seq_cutoff_policy_all(ocf_cache_t cache,
ocf_seq_cutoff_policy policy) ocf_seq_cutoff_policy policy)
{ {
OCF_CHECK_NULL(cache); OCF_CHECK_NULL(cache);
return ocf_core_visit(cache, _cache_mng_set_core_seq_cutoff_policy, return ocf_core_visit(cache, _cache_mngt_set_core_seq_cutoff_policy,
&policy, true); &policy, true);
} }

View File

@ -55,7 +55,7 @@ struct ocf_mngt_cache_flush_context
purge_core purge_core
} op; } op;
/* ocf mngmt entry point completion */ /* ocf management entry point completion */
union { union {
ocf_mngt_cache_flush_end_t flush_cache; ocf_mngt_cache_flush_end_t flush_cache;
ocf_mngt_core_flush_end_t flush_core; ocf_mngt_core_flush_end_t flush_core;

View File

@ -4,7 +4,7 @@
*/ */
//<tested_file_path>src/mngt/ocf_mngt_cache.c</tested_file_path> //<tested_file_path>src/mngt/ocf_mngt_cache.c</tested_file_path>
//<tested_function>_cache_mng_set_cache_mode</tested_function> //<tested_function>_cache_mngt_set_cache_mode</tested_function>
/* /*
<functions_to_leave> <functions_to_leave>
@ -265,12 +265,12 @@ void __wrap_ocf_mngt_cache_save_finish(
{ {
} }
void _cache_mng_update_initial_dirty_clines(ocf_cache_t cache) void _cache_mngt_update_initial_dirty_clines(ocf_cache_t cache)
{ {
function_called(); function_called();
} }
static void _cache_mng_set_cache_mode_test01(void **state) static void _cache_mngt_set_cache_mode_test01(void **state)
{ {
ocf_cache_mode_t mode_old = -20; ocf_cache_mode_t mode_old = -20;
ocf_cache_mode_t mode_new = ocf_cache_mode_none; ocf_cache_mode_t mode_new = ocf_cache_mode_none;
@ -291,13 +291,13 @@ static void _cache_mng_set_cache_mode_test01(void **state)
expect_function_call(__wrap_ocf_cache_mode_is_valid); expect_function_call(__wrap_ocf_cache_mode_is_valid);
will_return(__wrap_ocf_cache_mode_is_valid, 0); will_return(__wrap_ocf_cache_mode_is_valid, 0);
result = _cache_mng_set_cache_mode(&cache, mode_new); result = _cache_mngt_set_cache_mode(&cache, mode_new);
assert_int_equal(result, -OCF_ERR_INVAL); assert_int_equal(result, -OCF_ERR_INVAL);
assert_int_equal(cache.conf_meta->cache_mode, mode_old); assert_int_equal(cache.conf_meta->cache_mode, mode_old);
} }
static void _cache_mng_set_cache_mode_test02(void **state) static void _cache_mngt_set_cache_mode_test02(void **state)
{ {
ocf_cache_mode_t mode_old = ocf_cache_mode_wt; ocf_cache_mode_t mode_old = ocf_cache_mode_wt;
ocf_cache_mode_t mode_new = ocf_cache_mode_wt; ocf_cache_mode_t mode_new = ocf_cache_mode_wt;
@ -322,13 +322,13 @@ static void _cache_mng_set_cache_mode_test02(void **state)
expect_function_call(__wrap_ocf_log_raw); expect_function_call(__wrap_ocf_log_raw);
will_return(__wrap_ocf_log_raw, 0); will_return(__wrap_ocf_log_raw, 0);
result = _cache_mng_set_cache_mode(&cache, mode_new); result = _cache_mngt_set_cache_mode(&cache, mode_new);
assert_int_equal(result, 0); assert_int_equal(result, 0);
assert_int_equal(cache.conf_meta->cache_mode, mode_old); assert_int_equal(cache.conf_meta->cache_mode, mode_old);
} }
static void _cache_mng_set_cache_mode_test03(void **state) static void _cache_mngt_set_cache_mode_test03(void **state)
{ {
ocf_cache_mode_t mode_old = ocf_cache_mode_wb; ocf_cache_mode_t mode_old = ocf_cache_mode_wb;
ocf_cache_mode_t mode_new = ocf_cache_mode_wa; ocf_cache_mode_t mode_new = ocf_cache_mode_wa;
@ -351,18 +351,18 @@ static void _cache_mng_set_cache_mode_test03(void **state)
expect_function_call(__wrap_ocf_cache_mode_is_valid); expect_function_call(__wrap_ocf_cache_mode_is_valid);
will_return(__wrap_ocf_cache_mode_is_valid, 1); will_return(__wrap_ocf_cache_mode_is_valid, 1);
expect_function_call(_cache_mng_update_initial_dirty_clines); expect_function_call(_cache_mngt_update_initial_dirty_clines);
expect_function_call(__wrap_ocf_log_raw); expect_function_call(__wrap_ocf_log_raw);
will_return(__wrap_ocf_log_raw, 0); will_return(__wrap_ocf_log_raw, 0);
result = _cache_mng_set_cache_mode(&cache, mode_new); result = _cache_mngt_set_cache_mode(&cache, mode_new);
assert_int_equal(result, 0); assert_int_equal(result, 0);
assert_int_equal(cache.conf_meta->cache_mode, mode_new); assert_int_equal(cache.conf_meta->cache_mode, mode_new);
} }
static void _cache_mng_set_cache_mode_test04(void **state) static void _cache_mngt_set_cache_mode_test04(void **state)
{ {
ocf_cache_mode_t mode_old = ocf_cache_mode_wt; ocf_cache_mode_t mode_old = ocf_cache_mode_wt;
ocf_cache_mode_t mode_new = ocf_cache_mode_wa; ocf_cache_mode_t mode_new = ocf_cache_mode_wa;
@ -387,7 +387,7 @@ static void _cache_mng_set_cache_mode_test04(void **state)
expect_function_call(__wrap_ocf_log_raw); expect_function_call(__wrap_ocf_log_raw);
will_return(__wrap_ocf_log_raw, 0); will_return(__wrap_ocf_log_raw, 0);
result = _cache_mng_set_cache_mode(&cache, mode_new); result = _cache_mngt_set_cache_mode(&cache, mode_new);
assert_int_equal(result, 0); assert_int_equal(result, 0);
assert_int_equal(cache.conf_meta->cache_mode, mode_new); assert_int_equal(cache.conf_meta->cache_mode, mode_new);
@ -399,13 +399,13 @@ static void _cache_mng_set_cache_mode_test04(void **state)
int main(void) int main(void)
{ {
const struct CMUnitTest tests[] = { const struct CMUnitTest tests[] = {
cmocka_unit_test(_cache_mng_set_cache_mode_test01), cmocka_unit_test(_cache_mngt_set_cache_mode_test01),
cmocka_unit_test(_cache_mng_set_cache_mode_test02), cmocka_unit_test(_cache_mngt_set_cache_mode_test02),
cmocka_unit_test(_cache_mng_set_cache_mode_test03), cmocka_unit_test(_cache_mngt_set_cache_mode_test03),
cmocka_unit_test(_cache_mng_set_cache_mode_test04), cmocka_unit_test(_cache_mngt_set_cache_mode_test04),
}; };
print_message("Unit test of _cache_mng_set_cache_mode\n"); print_message("Unit test of _cache_mngt_set_cache_mode\n");
return cmocka_run_group_tests(tests, NULL, NULL); return cmocka_run_group_tests(tests, NULL, NULL);
} }

View File

@ -45,7 +45,7 @@ ocf_ctx_t __wrap_ocf_cache_get_ctx(ocf_cache_t cache)
function_called(); function_called();
} }
int __wrap_ocf_mng_cache_set_fallback_pt(ocf_cache_t cache) int __wrap_ocf_mngt_cache_set_fallback_pt(ocf_cache_t cache)
{ {
function_called(); function_called();
} }