Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 1 | #ifndef __LINUX_PAGE_OWNER_H |
| 2 | #define __LINUX_PAGE_OWNER_H |
| 3 | |
| 4 | #ifdef CONFIG_PAGE_OWNER |
| 5 | extern bool page_owner_inited; |
| 6 | extern struct page_ext_operations page_owner_ops; |
| 7 | |
| 8 | extern void __reset_page_owner(struct page *page, unsigned int order); |
| 9 | extern void __set_page_owner(struct page *page, |
| 10 | unsigned int order, gfp_t gfp_mask); |
| 11 | |
| 12 | static inline void reset_page_owner(struct page *page, unsigned int order) |
| 13 | { |
| 14 | if (likely(!page_owner_inited)) |
| 15 | return; |
| 16 | |
| 17 | __reset_page_owner(page, order); |
| 18 | } |
| 19 | |
| 20 | static inline void set_page_owner(struct page *page, |
| 21 | unsigned int order, gfp_t gfp_mask) |
| 22 | { |
| 23 | if (likely(!page_owner_inited)) |
| 24 | return; |
| 25 | |
| 26 | __set_page_owner(page, order, gfp_mask); |
| 27 | } |
| 28 | #else |
| 29 | static inline void reset_page_owner(struct page *page, unsigned int order) |
| 30 | { |
| 31 | } |
| 32 | static inline void set_page_owner(struct page *page, |
| 33 | unsigned int order, gfp_t gfp_mask) |
| 34 | { |
| 35 | } |
| 36 | |
| 37 | #endif /* CONFIG_PAGE_OWNER */ |
| 38 | #endif /* __LINUX_PAGE_OWNER_H */ |