staging: ion: remove order from struct page_info
ION system heap uses an internal data structure, struct page_info, for tracking down the meta information of the pages allocated from the pool. Now that the pool returns compound pages, we don't need to store page order in struct page_info. Signed-off-by: Heesub Shin <heesub.shin@samsung.com> Reviewed-by: Mitchel Humpherys <mitchelh@codeaurora.org> Tested-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2b3cffc931
commit
d10e4ffd64
|
@ -54,7 +54,6 @@ struct ion_system_heap {
|
||||||
|
|
||||||
struct page_info {
|
struct page_info {
|
||||||
struct page *page;
|
struct page *page;
|
||||||
unsigned int order;
|
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -123,7 +122,6 @@ static struct page_info *alloc_largest_available(struct ion_system_heap *heap,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
info->page = page;
|
info->page = page;
|
||||||
info->order = orders[i];
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
kfree(info);
|
kfree(info);
|
||||||
|
@ -160,8 +158,8 @@ static int ion_system_heap_allocate(struct ion_heap *heap,
|
||||||
if (!info)
|
if (!info)
|
||||||
goto free_pages;
|
goto free_pages;
|
||||||
list_add_tail(&info->list, &pages);
|
list_add_tail(&info->list, &pages);
|
||||||
size_remaining -= PAGE_SIZE << info->order;
|
size_remaining -= PAGE_SIZE << compound_order(info->page);
|
||||||
max_order = info->order;
|
max_order = compound_order(info->page);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
|
table = kmalloc(sizeof(struct sg_table), GFP_KERNEL);
|
||||||
|
@ -174,7 +172,7 @@ static int ion_system_heap_allocate(struct ion_heap *heap,
|
||||||
sg = table->sgl;
|
sg = table->sgl;
|
||||||
list_for_each_entry_safe(info, tmp_info, &pages, list) {
|
list_for_each_entry_safe(info, tmp_info, &pages, list) {
|
||||||
struct page *page = info->page;
|
struct page *page = info->page;
|
||||||
sg_set_page(sg, page, PAGE_SIZE << info->order, 0);
|
sg_set_page(sg, page, PAGE_SIZE << compound_order(page), 0);
|
||||||
sg = sg_next(sg);
|
sg = sg_next(sg);
|
||||||
list_del(&info->list);
|
list_del(&info->list);
|
||||||
kfree(info);
|
kfree(info);
|
||||||
|
@ -187,7 +185,8 @@ free_table:
|
||||||
kfree(table);
|
kfree(table);
|
||||||
free_pages:
|
free_pages:
|
||||||
list_for_each_entry_safe(info, tmp_info, &pages, list) {
|
list_for_each_entry_safe(info, tmp_info, &pages, list) {
|
||||||
free_buffer_page(sys_heap, buffer, info->page, info->order);
|
free_buffer_page(sys_heap, buffer, info->page,
|
||||||
|
compound_order(info->page));
|
||||||
kfree(info);
|
kfree(info);
|
||||||
}
|
}
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
Loading…
Reference in a new issue