Split count_pages and update on metadata deinit#861
Merged
robertbaldyga merged 2 commits intoOpen-CAS:masterfrom Feb 6, 2025
Merged
Split count_pages and update on metadata deinit#861robertbaldyga merged 2 commits intoOpen-CAS:masterfrom
robertbaldyga merged 2 commits intoOpen-CAS:masterfrom
Conversation
bea7a3d to
26cfd37
Compare
robertbaldyga
requested changes
Feb 4, 2025
a8988c2 to
5d8da33
Compare
robertbaldyga
previously approved these changes
Feb 6, 2025
mmichal10
reviewed
Feb 6, 2025
src/metadata/metadata_internal.h
Outdated
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; |
Contributor
There was a problem hiding this comment.
ocf_cache_line_t -> uint32_t
src/metadata/metadata.c
Outdated
| 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); |
Contributor
There was a problem hiding this comment.
+ ctrl->count_pages_fixed + ctrl->count_pages_variable -> + ocf_metadata_get_pages_count()
src/metadata/metadata.c
Outdated
|
|
||
| cache->device->metadata_offset = ctrl->count_pages * PAGE_SIZE; | ||
| cache->device->metadata_offset = | ||
| (ctrl->count_pages_fixed + ctrl->count_pages_variable) * PAGE_SIZE; |
Contributor
There was a problem hiding this comment.
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; |
Contributor
There was a problem hiding this comment.
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) { |
Contributor
There was a problem hiding this comment.
ocf_metadata_get_pages_count()
f0646ef to
db0e776
Compare
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>
db0e776 to
d8feef3
Compare
mmichal10
approved these changes
Feb 6, 2025
robertbaldyga
approved these changes
Feb 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This resets count_pages_variable on cache-detach, so during the following cache-attach metadata size is calculated properly.