mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
[PATCH] mm: make compound page destructor handling explicit
Currently we we use the lru head link of the second page of a compound page to hold its destructor. This was ok when it was purely an internal implmentation detail. However, hugetlbfs overrides this destructor violating the layering. Abstract this out as explicit calls, also introduce a type for the callback function allowing them to be type checked. For each callback we pre-declare the function, causing a type error on definition rather than on use elsewhere. [[email protected]: cleanups] Signed-off-by: Andy Whitcroft <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
3c517a6132
commit
33f2ef89f8
4 changed files with 22 additions and 4 deletions
|
|
@ -57,9 +57,9 @@ static void put_compound_page(struct page *page)
|
|||
{
|
||||
page = (struct page *)page_private(page);
|
||||
if (put_page_testzero(page)) {
|
||||
void (*dtor)(struct page *page);
|
||||
compound_page_dtor *dtor;
|
||||
|
||||
dtor = (void (*)(struct page *))page[1].lru.next;
|
||||
dtor = get_compound_page_dtor(page);
|
||||
(*dtor)(page);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue