diff --git a/include/linux/mm.h b/include/linux/mm.h index ef859426a836..f79d114a20b1 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -736,6 +736,12 @@ static inline void set_compound_order(struct page *page, unsigned int order) page[1].compound_order = order; } +/* Returns the number of bytes in this potentially compound page. */ +static inline unsigned long page_size(struct page *page) +{ + return PAGE_SIZE << compound_order(page); +} + void free_compound_page(struct page *page); #ifdef CONFIG_MMU