Change type of pages count variables to uint32_t

Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
This commit is contained in:
Daniel Madej 2025-02-06 11:54:53 +01:00
parent a15003d43e
commit d8feef301d
4 changed files with 8 additions and 8 deletions

View File

@ -715,7 +715,7 @@ int ocf_metadata_init_variable_size(struct ocf_cache *cache,
OCF_DEBUG_PARAM(cache, "Metadata count pages fixed = %u", ctrl->count_pages_fixed);
OCF_DEBUG_PARAM(cache, "Metadata count pages variable = %u", ctrl->count_pages_variable);
OCF_DEBUG_PARAM(cache, "Metadata end pages = %u", ctrl->start_page
+ ctrl->count_pages_fixed + ctrl->count_pages_variable);
+ ocf_metadata_get_pages_count(cache));
superblock = ctrl->segment[metadata_segment_sb_config];
@ -790,7 +790,7 @@ finalize:
ctrl->raw_desc[metadata_segment_hash].entries;
cache->device->metadata_offset =
(ctrl->count_pages_fixed + ctrl->count_pages_variable) * PAGE_SIZE;
ocf_metadata_get_pages_count(cache) * PAGE_SIZE;
cache->conf_meta->cachelines = ctrl->cachelines;
cache->conf_meta->line_size = line_size;
@ -949,7 +949,7 @@ void ocf_metadata_init_hash_table(ocf_pipeline_t pipeline, void *priv,
/*
* Get count of pages that is dedicated for metadata
*/
ocf_cache_line_t ocf_metadata_get_pages_count(struct ocf_cache *cache)
uint32_t ocf_metadata_get_pages_count(struct ocf_cache *cache)
{
struct ocf_metadata_ctrl *ctrl = NULL;

View File

@ -1,5 +1,6 @@
/*
* Copyright(c) 2012-2022 Intel Corporation
* Copyright(c) 2025 Huawei Technologies
* SPDX-License-Identifier: BSD-3-Clause
*/
@ -125,7 +126,7 @@ ocf_metadata_get_cachelines_count(struct ocf_cache *cache);
* @param cache - Cache instance
* @return Pages required for store metadata on cache device
*/
ocf_cache_line_t ocf_metadata_get_pages_count(struct ocf_cache *cache);
uint32_t ocf_metadata_get_pages_count(struct ocf_cache *cache);
/**
* @brief Flush metadata

View File

@ -21,8 +21,8 @@
struct ocf_metadata_ctrl {
ocf_cache_line_t cachelines;
ocf_cache_line_t start_page;
ocf_cache_line_t count_pages_fixed;
ocf_cache_line_t count_pages_variable;
uint32_t count_pages_fixed;
uint32_t count_pages_variable;
uint32_t device_lines;
size_t mapping_size;
struct ocf_metadata_raw raw_desc[metadata_segment_max];

View File

@ -76,7 +76,6 @@ static void passive_io_page_lock_acquired(struct ocf_request *req)
int ocf_metadata_passive_update(struct ocf_request *master)
{
ocf_cache_t cache = master->cache;
struct ocf_metadata_ctrl *ctrl = cache->metadata.priv;
uint64_t io_start_page = BYTES_TO_PAGES(master->addr);
uint64_t io_end_page = io_start_page + BYTES_TO_PAGES(master->bytes);
struct ocf_request *req;
@ -87,7 +86,7 @@ int ocf_metadata_passive_update(struct ocf_request *master)
return 0;
}
if (io_start_page >= ctrl->count_pages_fixed + ctrl->count_pages_variable) {
if (io_start_page >= ocf_metadata_get_pages_count(cache)) {
master->complete(master, 0);
return 0;
}