Pass user's params when opening a core volume

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@huawei.com>
This commit is contained in:
Gershon Geva 2023-10-08 12:33:06 +03:00 committed by Michal Mielewczyk
parent 87b16aef6a
commit 2096e34489
3 changed files with 9 additions and 1 deletions

View File

@ -34,6 +34,12 @@ struct ocf_mngt_core_config {
*/ */
uint8_t volume_type; uint8_t volume_type;
/**
* @brief Optional opaque volume parameters, passed down to core volume
* open callback
*/
void *volume_params;
/** /**
* @brief Add core to pool if cache isn't present or add core to * @brief Add core to pool if cache isn't present or add core to
* earlier loaded cache * earlier loaded cache

View File

@ -414,7 +414,7 @@ static void ocf_mngt_cache_add_core_insert(ocf_pipeline_t pipeline,
OCF_PL_FINISH_RET(pipeline, result); OCF_PL_FINISH_RET(pipeline, result);
} }
result = ocf_volume_open(volume, NULL); result = ocf_volume_open(volume, cfg->volume_params);
if (result) if (result)
OCF_PL_FINISH_RET(pipeline, result); OCF_PL_FINISH_RET(pipeline, result);

View File

@ -1,5 +1,6 @@
# #
# Copyright(c) 2019-2022 Intel Corporation # Copyright(c) 2019-2022 Intel Corporation
# Copyright(c) 2024 Huawei Technologies
# SPDX-License-Identifier: BSD-3-Clause # SPDX-License-Identifier: BSD-3-Clause
# #
@ -44,6 +45,7 @@ class CoreConfig(Structure):
("_name", c_char * MAX_CORE_NAME_SIZE), ("_name", c_char * MAX_CORE_NAME_SIZE),
("_uuid", Uuid), ("_uuid", Uuid),
("_volume_type", c_uint8), ("_volume_type", c_uint8),
("_volume_params", c_void_p),
("_try_add", c_bool), ("_try_add", c_bool),
("_seq_cutoff_threshold", c_uint32), ("_seq_cutoff_threshold", c_uint32),
("_seq_cutoff_promotion_count", c_uint32), ("_seq_cutoff_promotion_count", c_uint32),