Commit 65ea1aff authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] simplify put_page()

By requiring that compound pages implement destructors we can drop some code
from put_page().
parent c8c855b5
...@@ -41,11 +41,10 @@ void put_page(struct page *page) ...@@ -41,11 +41,10 @@ void put_page(struct page *page)
if (unlikely(PageCompound(page))) { if (unlikely(PageCompound(page))) {
page = (struct page *)page->private; page = (struct page *)page->private;
if (put_page_testzero(page)) { if (put_page_testzero(page)) {
if (page[1].mapping) { /* destructor? */ void (*dtor)(struct page *page);
(*(void (*)(struct page *))page[1].mapping)(page);
} else { dtor = (void (*)(struct page *))page[1].mapping;
__page_cache_release(page); (*dtor)(page);
}
} }
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment