Skip to content
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

Compilation on ubuntu fixed (exceeded stack frame size) #4

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions modules/cas_cache/layer_upgrade.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ int _cas_upgrade_dump_io_class_visitor(ocf_cache_t cache,
uint32_t io_class_id, void *ctx)
{
int result = 0;
struct ocf_io_class_info info;
struct ocf_io_class_info *info = NULL;
struct _cas_upgrade_dump_io_class_visit_ctx *io_class_visit_ctx =
(struct _cas_upgrade_dump_io_class_visit_ctx*) ctx;
char *key = NULL;
Expand All @@ -430,7 +430,13 @@ int _cas_upgrade_dump_io_class_visitor(ocf_cache_t cache,
return result;
}

result = ocf_cache_io_class_get_info(cache, io_class_id, &info);
info = kmalloc(sizeof(*info), GFP_KERNEL);
if (info == NULL) {
result = -OCF_ERR_NO_MEM;
goto error;
}

result = ocf_cache_io_class_get_info(cache, io_class_id, info);
if (result)
goto error;

Expand All @@ -443,7 +449,7 @@ int _cas_upgrade_dump_io_class_visitor(ocf_cache_t cache,
goto error;

result = cas_properties_add_string(cache_props, key,
info.name, CAS_PROPERTIES_CONST);
info->name, CAS_PROPERTIES_CONST);
if (result) {
printk(KERN_ERR OCF_PREFIX_SHORT
"Error during adding io class name\n");
Expand All @@ -456,7 +462,7 @@ int _cas_upgrade_dump_io_class_visitor(ocf_cache_t cache,
goto error;

result = cas_properties_add_uint(cache_props, key,
info.min_size, CAS_PROPERTIES_CONST);
info->min_size, CAS_PROPERTIES_CONST);
if (result) {
printk(KERN_ERR OCF_PREFIX_SHORT
"Error during adding io class min size\n");
Expand All @@ -482,7 +488,7 @@ int _cas_upgrade_dump_io_class_visitor(ocf_cache_t cache,
goto error;

result = cas_properties_add_uint(cache_props, key,
info.max_size, CAS_PROPERTIES_CONST);
info->max_size, CAS_PROPERTIES_CONST);
if (result) {
printk(KERN_ERR OCF_PREFIX_SHORT
"Error during adding io class max size\n");
Expand All @@ -495,7 +501,7 @@ int _cas_upgrade_dump_io_class_visitor(ocf_cache_t cache,
goto error;

result = cas_properties_add_uint(cache_props, key,
info.priority, CAS_PROPERTIES_CONST);
info->priority, CAS_PROPERTIES_CONST);
if (result) {
printk(KERN_ERR OCF_PREFIX_SHORT
"Error during adding io class priority\n");
Expand All @@ -508,7 +514,7 @@ int _cas_upgrade_dump_io_class_visitor(ocf_cache_t cache,
goto error;

result = cas_properties_add_uint(cache_props, key,
info.cache_mode, CAS_PROPERTIES_CONST);
info->cache_mode, CAS_PROPERTIES_CONST);
if (result) {
printk(KERN_ERR OCF_PREFIX_SHORT
"Error during adding io class cache mode\n");
Expand All @@ -517,6 +523,7 @@ int _cas_upgrade_dump_io_class_visitor(ocf_cache_t cache,

error:
kfree(key);
kfree(info);
io_class_visit_ctx->error = result;
return result;

Expand Down