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); |
Joonsoo Kim | e2cfc91 | 2015-07-17 16:24:18 -0700 | [diff] [blame] | 11 | extern gfp_t __get_page_owner_gfp(struct page *page); |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 12 | |
| 13 | static inline void reset_page_owner(struct page *page, unsigned int order) |
| 14 | { |
| 15 | if (likely(!page_owner_inited)) |
| 16 | return; |
| 17 | |
| 18 | __reset_page_owner(page, order); |
| 19 | } |
| 20 | |
| 21 | static inline void set_page_owner(struct page *page, |
| 22 | unsigned int order, gfp_t gfp_mask) |
| 23 | { |
| 24 | if (likely(!page_owner_inited)) |
| 25 | return; |
| 26 | |
| 27 | __set_page_owner(page, order, gfp_mask); |
| 28 | } |
Joonsoo Kim | e2cfc91 | 2015-07-17 16:24:18 -0700 | [diff] [blame] | 29 | |
| 30 | static inline gfp_t get_page_owner_gfp(struct page *page) |
| 31 | { |
| 32 | if (likely(!page_owner_inited)) |
| 33 | return 0; |
| 34 | |
| 35 | return __get_page_owner_gfp(page); |
| 36 | } |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 37 | #else |
| 38 | static inline void reset_page_owner(struct page *page, unsigned int order) |
| 39 | { |
| 40 | } |
| 41 | static inline void set_page_owner(struct page *page, |
| 42 | unsigned int order, gfp_t gfp_mask) |
| 43 | { |
| 44 | } |
Joonsoo Kim | e2cfc91 | 2015-07-17 16:24:18 -0700 | [diff] [blame] | 45 | static inline gfp_t get_page_owner_gfp(struct page *page) |
| 46 | { |
| 47 | return 0; |
| 48 | } |
Joonsoo Kim | 48c96a3 | 2014-12-12 16:56:01 -0800 | [diff] [blame] | 49 | |
| 50 | #endif /* CONFIG_PAGE_OWNER */ |
| 51 | #endif /* __LINUX_PAGE_OWNER_H */ |