|
@@ -169,20 +169,17 @@ static void bad_page(struct page *page)
|
|
|
* All pages have PG_compound set. All pages have their ->private pointing at
|
|
|
* the head page (even the head page has this).
|
|
|
*
|
|
|
- * The first tail page's ->mapping, if non-zero, holds the address of the
|
|
|
- * compound page's put_page() function.
|
|
|
- *
|
|
|
- * The order of the allocation is stored in the first tail page's ->index
|
|
|
- * This is only for debug at present. This usage means that zero-order pages
|
|
|
- * may not be compound.
|
|
|
+ * The first tail page's ->lru.next holds the address of the compound page's
|
|
|
+ * put_page() function. Its ->lru.prev holds the order of allocation.
|
|
|
+ * This usage means that zero-order pages may not be compound.
|
|
|
*/
|
|
|
static void prep_compound_page(struct page *page, unsigned long order)
|
|
|
{
|
|
|
int i;
|
|
|
int nr_pages = 1 << order;
|
|
|
|
|
|
- page[1].mapping = NULL;
|
|
|
- page[1].index = order;
|
|
|
+ page[1].lru.next = NULL; /* set dtor */
|
|
|
+ page[1].lru.prev = (void *)order;
|
|
|
for (i = 0; i < nr_pages; i++) {
|
|
|
struct page *p = page + i;
|
|
|
|
|
@@ -196,7 +193,7 @@ static void destroy_compound_page(struct page *page, unsigned long order)
|
|
|
int i;
|
|
|
int nr_pages = 1 << order;
|
|
|
|
|
|
- if (unlikely(page[1].index != order))
|
|
|
+ if (unlikely((unsigned long)page[1].lru.prev != order))
|
|
|
bad_page(page);
|
|
|
|
|
|
for (i = 0; i < nr_pages; i++) {
|