Skip to content

Split count_pages and update on metadata deinit#861

Merged
robertbaldyga merged 2 commits intoOpen-CAS:masterfrom
Deixx:deinit-variable-metadata
Feb 6, 2025
Merged

Split count_pages and update on metadata deinit#861
robertbaldyga merged 2 commits intoOpen-CAS:masterfrom
Deixx:deinit-variable-metadata

Conversation

@Deixx
Copy link
Contributor

@Deixx Deixx commented Jan 20, 2025

This resets count_pages_variable on cache-detach, so during the following cache-attach metadata size is calculated properly.

@Deixx Deixx changed the title Update count_pages on metadata deinit Update count_pages_variable on metadata deinit Feb 4, 2025
@Deixx Deixx force-pushed the deinit-variable-metadata branch 2 times, most recently from bea7a3d to 26cfd37 Compare February 4, 2025 11:39
@Deixx Deixx changed the title Update count_pages_variable on metadata deinit Split count_pages and update on metadata deinit Feb 4, 2025
@Deixx Deixx force-pushed the deinit-variable-metadata branch 2 times, most recently from a8988c2 to 5d8da33 Compare February 6, 2025 07:58
robertbaldyga
robertbaldyga previously approved these changes Feb 6, 2025
Comment on lines 23 to 25
ocf_cache_line_t start_page;
ocf_cache_line_t count_pages;
ocf_cache_line_t count_pages_fixed;
ocf_cache_line_t count_pages_variable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ocf_cache_line_t -> uint32_t

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);
+ ctrl->count_pages_fixed + ctrl->count_pages_variable);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ ctrl->count_pages_fixed + ctrl->count_pages_variable -> + ocf_metadata_get_pages_count()


cache->device->metadata_offset = ctrl->count_pages * PAGE_SIZE;
cache->device->metadata_offset =
(ctrl->count_pages_fixed + ctrl->count_pages_variable) * PAGE_SIZE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ctrl->count_pages_fixed + ctrl->count_pages_variable -> ocf_metadata_get_pages_count()

ctrl = (struct ocf_metadata_ctrl *) cache->metadata.priv;

return ctrl->count_pages;
return ctrl->count_pages_fixed + ctrl->count_pages_variable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the return type of this function

}

if (io_start_page >= ctrl->count_pages) {
if (io_start_page >= ctrl->count_pages_fixed + ctrl->count_pages_variable) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ocf_metadata_get_pages_count()

@Deixx Deixx force-pushed the deinit-variable-metadata branch 2 times, most recently from f0646ef to db0e776 Compare February 6, 2025 10:53
Deixx added 2 commits February 6, 2025 11:54
This resets count_pages_variable on cache-detach, so during the following
cache-attach metadata size is calculated properly.

Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
Signed-off-by: Daniel Madej <daniel.madej@huawei.com>
@Deixx Deixx force-pushed the deinit-variable-metadata branch from db0e776 to d8feef3 Compare February 6, 2025 10:55
@robertbaldyga robertbaldyga merged commit bb4d673 into Open-CAS:master Feb 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants