-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split count_pages and update on metadata deinit #861
Conversation
bea7a3d
to
26cfd37
Compare
a8988c2
to
5d8da33
Compare
src/metadata/metadata_internal.h
Outdated
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; |
There was a problem hiding this comment.
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
src/metadata/metadata.c
Outdated
OCF_DEBUG_PARAM(cache, "Metadata end pages = %u", ctrl->start_page | ||
+ ctrl->count_pages); | ||
+ ctrl->count_pages_fixed + ctrl->count_pages_variable); |
There was a problem hiding this comment.
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()
src/metadata/metadata.c
Outdated
@@ -787,7 +789,8 @@ int ocf_metadata_init_variable_size(struct ocf_cache *cache, | |||
cache->device->hash_table_entries = | |||
ctrl->raw_desc[metadata_segment_hash].entries; | |||
|
|||
cache->device->metadata_offset = ctrl->count_pages * PAGE_SIZE; | |||
cache->device->metadata_offset = | |||
(ctrl->count_pages_fixed + ctrl->count_pages_variable) * PAGE_SIZE; |
There was a problem hiding this comment.
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()
@@ -954,7 +957,7 @@ ocf_cache_line_t ocf_metadata_get_pages_count(struct ocf_cache *cache) | |||
|
|||
ctrl = (struct ocf_metadata_ctrl *) cache->metadata.priv; | |||
|
|||
return ctrl->count_pages; | |||
return ctrl->count_pages_fixed + ctrl->count_pages_variable; |
There was a problem hiding this comment.
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
@@ -87,7 +87,7 @@ int ocf_metadata_passive_update(struct ocf_request *master) | |||
return 0; | |||
} | |||
|
|||
if (io_start_page >= ctrl->count_pages) { | |||
if (io_start_page >= ctrl->count_pages_fixed + ctrl->count_pages_variable) { |
There was a problem hiding this comment.
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()
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
This resets count_pages_variable on cache-detach, so during the following cache-attach metadata size is calculated properly.