Aesthetic changes
Aesthetic changes, typos fix and delete recursive inclusions. Signed-off-by: Slawomir_Jankowski <slawomir.jankowski@intel.com>
This commit is contained in:
parent
e02821d399
commit
0696ec1f9c
9
env/posix/ocf_env.c
vendored
9
env/posix/ocf_env.c
vendored
@ -7,6 +7,7 @@
|
|||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <execinfo.h>
|
#include <execinfo.h>
|
||||||
|
|
||||||
|
/* ALLOCATOR */
|
||||||
struct _env_allocator {
|
struct _env_allocator {
|
||||||
/*!< Memory pool ID unique name */
|
/*!< Memory pool ID unique name */
|
||||||
char *name;
|
char *name;
|
||||||
@ -45,7 +46,6 @@ void *env_allocator_new(env_allocator *allocator)
|
|||||||
return &item->data;
|
return &item->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
env_allocator *env_allocator_create(uint32_t size, const char *fmt_name, ...)
|
env_allocator *env_allocator_create(uint32_t size, const char *fmt_name, ...)
|
||||||
{
|
{
|
||||||
char name[OCF_ALLOCATOR_NAME_MAX] = { '\0' };
|
char name[OCF_ALLOCATOR_NAME_MAX] = { '\0' };
|
||||||
@ -110,8 +110,7 @@ void env_allocator_destroy(env_allocator *allocator)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *** DEBUGING *** */
|
/* DEBUGING */
|
||||||
|
|
||||||
#define ENV_TRACE_DEPTH 16
|
#define ENV_TRACE_DEPTH 16
|
||||||
|
|
||||||
void env_stack_trace(void)
|
void env_stack_trace(void)
|
||||||
@ -129,13 +128,13 @@ void env_stack_trace(void)
|
|||||||
free(messages);
|
free(messages);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *** CRC *** */
|
/* CRC */
|
||||||
uint32_t env_crc32(uint32_t crc, uint8_t const *data, size_t len)
|
uint32_t env_crc32(uint32_t crc, uint8_t const *data, size_t len)
|
||||||
{
|
{
|
||||||
return crc32(crc, data, len);
|
return crc32(crc, data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *** execution contexts *** */
|
/* EXECUTION CONTEXTS */
|
||||||
pthread_mutex_t *exec_context_mutex;
|
pthread_mutex_t *exec_context_mutex;
|
||||||
|
|
||||||
static void __attribute__((constructor)) init_execution_context(void)
|
static void __attribute__((constructor)) init_execution_context(void)
|
||||||
|
2
env/posix/ocf_env_headers.h
vendored
2
env/posix/ocf_env_headers.h
vendored
@ -11,7 +11,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
/* TODO: Move prefix printing to context logger. */
|
/* TODO: Move prefix printing to context logger. */
|
||||||
#define OCF_LOGO "Intel(R) OCF"
|
#define OCF_LOGO "OCF"
|
||||||
#define OCF_PREFIX_SHORT "[" OCF_LOGO "] "
|
#define OCF_PREFIX_SHORT "[" OCF_LOGO "] "
|
||||||
#define OCF_PREFIX_LONG "Open CAS Framework"
|
#define OCF_PREFIX_LONG "Open CAS Framework"
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
* @brief OCF cache API
|
* @brief OCF cache API
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ocf_types.h"
|
|
||||||
#include "ocf_volume.h"
|
#include "ocf_volume.h"
|
||||||
#include "ocf_ctx.h"
|
#include "ocf_ctx.h"
|
||||||
#include "ocf_def.h"
|
#include "ocf_def.h"
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#ifndef __OCF_CORE_H__
|
#ifndef __OCF_CORE_H__
|
||||||
#define __OCF_CORE_H__
|
#define __OCF_CORE_H__
|
||||||
|
|
||||||
#include "ocf_types.h"
|
|
||||||
#include "ocf_volume.h"
|
#include "ocf_volume.h"
|
||||||
#include "ocf_io.h"
|
#include "ocf_io.h"
|
||||||
#include "ocf_mngt.h"
|
#include "ocf_mngt.h"
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
* @brief OCF library context API
|
* @brief OCF library context API
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ocf_types.h"
|
|
||||||
#include "ocf_volume.h"
|
#include "ocf_volume.h"
|
||||||
#include "ocf_logger.h"
|
#include "ocf_logger.h"
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
#ifndef __OCF_MNGT_H__
|
#ifndef __OCF_MNGT_H__
|
||||||
#define __OCF_MNGT_H__
|
#define __OCF_MNGT_H__
|
||||||
|
|
||||||
#include "ocf_types.h"
|
|
||||||
#include "ocf_cache.h"
|
#include "ocf_cache.h"
|
||||||
#include "ocf_core.h"
|
#include "ocf_core.h"
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
#include "ocf_types.h"
|
#include "ocf_types.h"
|
||||||
#include "ocf_env.h"
|
#include "ocf_env.h"
|
||||||
#include "ocf_err.h"
|
|
||||||
|
|
||||||
struct ocf_io;
|
struct ocf_io;
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ class TestGenerator(object):
|
|||||||
def get_autowrap_file_include(self, test_file_path):
|
def get_autowrap_file_include(self, test_file_path):
|
||||||
autowrap_file = test_file_path.rsplit(".", 1)[0]
|
autowrap_file = test_file_path.rsplit(".", 1)[0]
|
||||||
autowrap_file = autowrap_file.replace(self.main_UT_dir, "")
|
autowrap_file = autowrap_file.replace(self.main_UT_dir, "")
|
||||||
autowrap_file += "_generated_warps.c"
|
autowrap_file += "_generated_wraps.c"
|
||||||
return "#include \"" + autowrap_file + "\"\n\n"
|
return "#include \"" + autowrap_file + "\"\n\n"
|
||||||
|
|
||||||
def get_includes(self, abs_path_to_tested_file):
|
def get_includes(self, abs_path_to_tested_file):
|
||||||
|
@ -15,7 +15,7 @@ framework_script_path = os.path.join(script_path, "../framework/add_new_test_fil
|
|||||||
framework_script_path = os.path.normpath(framework_script_path)
|
framework_script_path = os.path.normpath(framework_script_path)
|
||||||
status, output = commands.getstatusoutput(framework_script_path + " " + args)
|
status, output = commands.getstatusoutput(framework_script_path + " " + args)
|
||||||
|
|
||||||
print output
|
print(output)
|
||||||
|
|
||||||
if status == 0:
|
if status == 0:
|
||||||
path = output.split(" ", 1)[0]
|
path = output.split(" ", 1)[0]
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "../mngt/ocf_mngt_common.h"
|
#include "../mngt/ocf_mngt_common.h"
|
||||||
#include "../metadata/metadata.h"
|
#include "../metadata/metadata.h"
|
||||||
|
|
||||||
#include "cleaning/cleaning.c/ocf_cleaner_run_test_generated_warps.c"
|
#include "cleaning/cleaning.c/ocf_cleaner_run_test_generated_wraps.c"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mocked functions. Here we must deliver functions definitions which are not
|
* Mocked functions. Here we must deliver functions definitions which are not
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "ocf_metadata_concurrency.h"
|
#include "ocf_metadata_concurrency.h"
|
||||||
#include "../metadata/metadata_misc.h"
|
#include "../metadata/metadata_misc.h"
|
||||||
|
|
||||||
#include "concurrency/ocf_metadata_concurrency.c/ocf_metadata_concurrency_generated_warps.c"
|
#include "concurrency/ocf_metadata_concurrency.c/ocf_metadata_concurrency_generated_wraps.c"
|
||||||
|
|
||||||
void __wrap_ocf_metadata_hash_lock(struct ocf_metadata_lock *metadata_lock,
|
void __wrap_ocf_metadata_hash_lock(struct ocf_metadata_lock *metadata_lock,
|
||||||
ocf_cache_line_t hash, int rw)
|
ocf_cache_line_t hash, int rw)
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "metadata.h"
|
#include "metadata.h"
|
||||||
#include "../utils/utils_cache_line.h"
|
#include "../utils/utils_cache_line.h"
|
||||||
|
|
||||||
#include "metadata/metadata_collision.c/metadata_collision_generated_warps.c"
|
#include "metadata/metadata_collision.c/metadata_collision_generated_wraps.c"
|
||||||
|
|
||||||
static void metadata_hash_func_test01(void **state)
|
static void metadata_hash_func_test01(void **state)
|
||||||
{
|
{
|
||||||
|
@ -40,7 +40,7 @@ ocf_mngt_cache_mode_has_lazy_write
|
|||||||
#include "../ocf_ctx_priv.h"
|
#include "../ocf_ctx_priv.h"
|
||||||
#include "../cleaning/cleaning.h"
|
#include "../cleaning/cleaning.h"
|
||||||
|
|
||||||
#include "mngt/ocf_mngt_cache.c/_cache_mngt_set_cache_mode_test_generated_warps.c"
|
#include "mngt/ocf_mngt_cache.c/_cache_mngt_set_cache_mode_test_generated_wraps.c"
|
||||||
/*
|
/*
|
||||||
* Mocked functions
|
* Mocked functions
|
||||||
*/
|
*/
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include "../ocf_ctx_priv.h"
|
#include "../ocf_ctx_priv.h"
|
||||||
#include "../cleaning/cleaning.h"
|
#include "../cleaning/cleaning.h"
|
||||||
|
|
||||||
#include "mngt/ocf_mngt_cache.c/ocf_mngt_cache_set_fallback_pt_error_threshold_generated_warps.c"
|
#include "mngt/ocf_mngt_cache.c/ocf_mngt_cache_set_fallback_pt_error_threshold_generated_wraps.c"
|
||||||
|
|
||||||
int __wrap_ocf_log_raw(ocf_logger_t logger, ocf_logger_lvl_t lvl,
|
int __wrap_ocf_log_raw(ocf_logger_t logger, ocf_logger_lvl_t lvl,
|
||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
#include "../eviction/ops.h"
|
#include "../eviction/ops.h"
|
||||||
#include "ocf_env.h"
|
#include "ocf_env.h"
|
||||||
|
|
||||||
#include "mngt/ocf_mngt_io_class.c/ocf_mngt_io_class_generated_warps.c"
|
#include "mngt/ocf_mngt_io_class.c/ocf_mngt_io_class_generated_wraps.c"
|
||||||
|
|
||||||
/* Functions mocked for testing purposes */
|
/* Functions mocked for testing purposes */
|
||||||
bool __wrap_ocf_part_is_added(struct ocf_user_part *part)
|
bool __wrap_ocf_part_is_added(struct ocf_user_part *part)
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include "ocf/ocf.h"
|
#include "ocf/ocf.h"
|
||||||
#include "metadata/metadata.h"
|
#include "metadata/metadata.h"
|
||||||
|
|
||||||
#include "ocf_freelist.c/ocf_freelist_get_put_generated_warps.c"
|
#include "ocf_freelist.c/ocf_freelist_get_put_generated_wraps.c"
|
||||||
|
|
||||||
ocf_cache_line_t __wrap_ocf_metadata_collision_table_entries(ocf_cache_t cache)
|
ocf_cache_line_t __wrap_ocf_metadata_collision_table_entries(ocf_cache_t cache)
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include "ocf/ocf.h"
|
#include "ocf/ocf.h"
|
||||||
#include "metadata/metadata.h"
|
#include "metadata/metadata.h"
|
||||||
|
|
||||||
#include "ocf_freelist.c/ocf_freelist_init_generated_warps.c"
|
#include "ocf_freelist.c/ocf_freelist_init_generated_wraps.c"
|
||||||
|
|
||||||
ocf_cache_line_t __wrap_ocf_metadata_collision_table_entries(ocf_cache_t cache)
|
ocf_cache_line_t __wrap_ocf_metadata_collision_table_entries(ocf_cache_t cache)
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#include "ocf/ocf.h"
|
#include "ocf/ocf.h"
|
||||||
#include "metadata/metadata.h"
|
#include "metadata/metadata.h"
|
||||||
|
|
||||||
#include "ocf_freelist.c/ocf_freelist_get_put_generated_warps.c"
|
#include "ocf_freelist.c/ocf_freelist_get_put_generated_wraps.c"
|
||||||
|
|
||||||
ocf_cache_line_t __wrap_ocf_metadata_collision_table_entries(ocf_cache_t cache)
|
ocf_cache_line_t __wrap_ocf_metadata_collision_table_entries(ocf_cache_t cache)
|
||||||
{
|
{
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
#include "ocf/ocf.h"
|
#include "ocf/ocf.h"
|
||||||
#include "metadata/metadata.h"
|
#include "metadata/metadata.h"
|
||||||
|
|
||||||
#include "ocf_freelist.c/ocf_freelist_populate_generated_warps.c"
|
#include "ocf_freelist.c/ocf_freelist_populate_generated_wraps.c"
|
||||||
|
|
||||||
ocf_cache_line_t __wrap_ocf_metadata_collision_table_entries(ocf_cache_t cache)
|
ocf_cache_line_t __wrap_ocf_metadata_collision_table_entries(ocf_cache_t cache)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "../utils/utils_refcnt.h"
|
#include "../utils/utils_refcnt.h"
|
||||||
|
|
||||||
#include "utils/utils_refcnt.c/utils_refcnt_dec_generated_warps.c"
|
#include "utils/utils_refcnt.c/utils_refcnt_dec_generated_wraps.c"
|
||||||
|
|
||||||
static void ocf_refcnt_dec_test01(void **state)
|
static void ocf_refcnt_dec_test01(void **state)
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "../utils/utils_refcnt.h"
|
#include "../utils/utils_refcnt.h"
|
||||||
|
|
||||||
#include "utils/utils_refcnt.c/utils_refcnt_freeze_generated_warps.c"
|
#include "utils/utils_refcnt.c/utils_refcnt_freeze_generated_wraps.c"
|
||||||
|
|
||||||
static void ocf_refcnt_freeze_test01(void **state)
|
static void ocf_refcnt_freeze_test01(void **state)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "../utils/utils_refcnt.h"
|
#include "../utils/utils_refcnt.h"
|
||||||
|
|
||||||
#include "utils/utils_refcnt.c/utils_refcnt_inc_generated_warps.c"
|
#include "utils/utils_refcnt.c/utils_refcnt_inc_generated_wraps.c"
|
||||||
|
|
||||||
static void ocf_refcnt_inc_test(void **state)
|
static void ocf_refcnt_inc_test(void **state)
|
||||||
{
|
{
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include "../utils/utils_refcnt.h"
|
#include "../utils/utils_refcnt.h"
|
||||||
|
|
||||||
#include "utils/utils_refcnt.c/utils_refcnt_init_generated_warps.c"
|
#include "utils/utils_refcnt.c/utils_refcnt_init_generated_wraps.c"
|
||||||
|
|
||||||
static void ocf_refcnt_init_test(void **state)
|
static void ocf_refcnt_init_test(void **state)
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "../utils/utils_refcnt.h"
|
#include "../utils/utils_refcnt.h"
|
||||||
|
|
||||||
#include "utils/utils_refcnt.c/utils_refcnt_register_zero_cb_generated_warps.c"
|
#include "utils/utils_refcnt.c/utils_refcnt_register_zero_cb_generated_wraps.c"
|
||||||
|
|
||||||
static void zero_cb(void *ctx)
|
static void zero_cb(void *ctx)
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "../utils/utils_refcnt.h"
|
#include "../utils/utils_refcnt.h"
|
||||||
|
|
||||||
#include "utils/utils_refcnt.c/utils_refcnt_unfreeze_generated_warps.c"
|
#include "utils/utils_refcnt.c/utils_refcnt_unfreeze_generated_wraps.c"
|
||||||
|
|
||||||
static void ocf_refcnt_unfreeze_test01(void **state)
|
static void ocf_refcnt_unfreeze_test01(void **state)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user