diff --git a/inc/ocf_mngt.h b/inc/ocf_mngt.h index 1a5fbbd..6dea576 100644 --- a/inc/ocf_mngt.h +++ b/inc/ocf_mngt.h @@ -908,13 +908,6 @@ int ocf_mngt_cache_get_fallback_pt_error_threshold(ocf_cache_t cache, */ int ocf_mngt_cache_reset_fallback_pt_error_counter(ocf_cache_t cache); -/** - * @brief Initialize core pool - * - * @param[in] ctx OCF context - */ -void ocf_mngt_core_pool_init(ocf_ctx_t ctx); - /** * @brief Get core pool count * @@ -972,11 +965,4 @@ int ocf_mngt_core_pool_visit(ocf_ctx_t ctx, */ void ocf_mngt_core_pool_remove(ocf_ctx_t ctx, ocf_volume_t volume); -/** - * @brief Deinit core pool - * - * @param[in] ctx OCF context - */ -void ocf_mngt_core_pool_deinit(ocf_ctx_t ctx); - #endif /* __OCF_CACHE_H__ */ diff --git a/src/mngt/ocf_mngt_core_pool.c b/src/mngt/ocf_mngt_core_pool.c index c94a72d..a80bb57 100644 --- a/src/mngt/ocf_mngt_core_pool.c +++ b/src/mngt/ocf_mngt_core_pool.c @@ -3,7 +3,6 @@ * SPDX-License-Identifier: BSD-3-Clause-Clear */ - #include "ocf/ocf.h" #include "ocf_mngt_common.h" #include "../ocf_priv.h" diff --git a/src/mngt/ocf_mngt_core_pool_priv.h b/src/mngt/ocf_mngt_core_pool_priv.h new file mode 100644 index 0000000..c3a1847 --- /dev/null +++ b/src/mngt/ocf_mngt_core_pool_priv.h @@ -0,0 +1,15 @@ +/* + * Copyright(c) 2012-2018 Intel Corporation + * SPDX-License-Identifier: BSD-3-Clause-Clear + */ + +#ifndef __OCF_MNGT_CORE_POOL_PRIV_H__ +#define __OCF_MNGT_CORE_POOL_PRIV_H__ + +#include "ocf/ocf.h" + +void ocf_mngt_core_pool_init(ocf_ctx_t ctx); + +void ocf_mngt_core_pool_deinit(ocf_ctx_t ctx); + +#endif /* __OCF_MNGT_CORE_POOL_PRIV_H__ */ diff --git a/src/mngt/ocf_mngt_core_priv.h b/src/mngt/ocf_mngt_core_priv.h index d6c376a..7b79ec8 100644 --- a/src/mngt/ocf_mngt_core_priv.h +++ b/src/mngt/ocf_mngt_core_priv.h @@ -3,11 +3,11 @@ * SPDX-License-Identifier: BSD-3-Clause-Clear */ -#ifndef __OCF_CORE_MNGT_PRIV_H__ -#define __OCF_CORE_MNGT_PRIV_H__ +#ifndef __OCF_MNGT_CORE_PRIV_H__ +#define __OCF_MNGT_CORE_PRIV_H__ #include "../ocf_core_priv.h" int ocf_mngt_core_init_front_volume(ocf_core_t core); -#endif /* __OCF_CORE_MNGT_PRIV_H__ */ +#endif /* __OCF_MNGT_CORE_PRIV_H__ */ diff --git a/src/ocf_ctx.c b/src/ocf_ctx.c index f28d72b..2fb3fc2 100644 --- a/src/ocf_ctx.c +++ b/src/ocf_ctx.c @@ -10,6 +10,7 @@ #include "ocf_utils.h" #include "ocf_logger_priv.h" #include "ocf_core_priv.h" +#include "mngt/ocf_mngt_core_pool_priv.h" /* * @@ -147,6 +148,8 @@ int ocf_ctx_init(ocf_ctx_t *ctx, const struct ocf_ctx_config *cfg) if (ret) goto err_utils; + ocf_mngt_core_pool_init(ocf_ctx); + *ctx = ocf_ctx; return 0; @@ -177,8 +180,8 @@ int ocf_ctx_exit(ocf_ctx_t ctx) if (result) return result; + ocf_mngt_core_pool_deinit(ctx); ocf_core_volume_type_deinit(ctx); - ocf_utils_deinit(ctx); ocf_logger_close(&ctx->logger); env_free(ctx);