diff options
Diffstat (limited to 'mm/slab.c')
-rw-r--r-- | mm/slab.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -590,6 +590,8 @@ static inline void page_set_cache(struct page *page, struct kmem_cache *cache) | |||
590 | 590 | ||
591 | static inline struct kmem_cache *page_get_cache(struct page *page) | 591 | static inline struct kmem_cache *page_get_cache(struct page *page) |
592 | { | 592 | { |
593 | if (unlikely(PageCompound(page))) | ||
594 | page = (struct page *)page_private(page); | ||
593 | return (struct kmem_cache *)page->lru.next; | 595 | return (struct kmem_cache *)page->lru.next; |
594 | } | 596 | } |
595 | 597 | ||
@@ -600,6 +602,8 @@ static inline void page_set_slab(struct page *page, struct slab *slab) | |||
600 | 602 | ||
601 | static inline struct slab *page_get_slab(struct page *page) | 603 | static inline struct slab *page_get_slab(struct page *page) |
602 | { | 604 | { |
605 | if (unlikely(PageCompound(page))) | ||
606 | page = (struct page *)page_private(page); | ||
603 | return (struct slab *)page->lru.prev; | 607 | return (struct slab *)page->lru.prev; |
604 | } | 608 | } |
605 | 609 | ||
@@ -2412,8 +2416,11 @@ static void set_slab_attr(struct kmem_cache *cachep, struct slab *slabp, | |||
2412 | struct page *page; | 2416 | struct page *page; |
2413 | 2417 | ||
2414 | /* Nasty!!!!!! I hope this is OK. */ | 2418 | /* Nasty!!!!!! I hope this is OK. */ |
2415 | i = 1 << cachep->gfporder; | ||
2416 | page = virt_to_page(objp); | 2419 | page = virt_to_page(objp); |
2420 | |||
2421 | i = 1; | ||
2422 | if (likely(!PageCompound(page))) | ||
2423 | i <<= cachep->gfporder; | ||
2417 | do { | 2424 | do { |
2418 | page_set_cache(page, cachep); | 2425 | page_set_cache(page, cachep); |
2419 | page_set_slab(page, slabp); | 2426 | page_set_slab(page, slabp); |