page = virt_to_page(x);
- if (unlikely(PageCompound(page)))
- page = page->first_page;
-
+ page = compound_head(page);
if (unlikely(PageError(page) && (s->flags & SLAB_STORE_USER)))
set_tracking(s, x, TRACK_FREE);
/* Figure out on which slab object the object resides */
static struct page *get_object_page(const void *x)
{
- struct page *page = virt_to_page(x);
-
- if (unlikely(PageCompound(page)))
- page = page->first_page;
+ struct page *page = compound_head(virt_to_page(x));
if (!PageSlab(page))
return NULL;
if (!x)
return;
- page = virt_to_page(x);
-
- if (unlikely(PageCompound(page)))
- page = page->first_page;
+ page = compound_head(virt_to_page(x));
s = page->slab;
return NULL;
}
- page = virt_to_page(p);
-
- if (unlikely(PageCompound(page)))
- page = page->first_page;
+ page = compound_head(virt_to_page(p));
new_cache = get_slab(new_size, flags);