blob: cacaabea8a0950115138c956737c2bd9d7c04a90 [file] [log] [blame]
Joonsoo Kim48c96a32014-12-12 16:56:01 -08001#ifndef __LINUX_PAGE_OWNER_H
2#define __LINUX_PAGE_OWNER_H
3
4#ifdef CONFIG_PAGE_OWNER
5extern bool page_owner_inited;
6extern struct page_ext_operations page_owner_ops;
7
8extern void __reset_page_owner(struct page *page, unsigned int order);
9extern void __set_page_owner(struct page *page,
10 unsigned int order, gfp_t gfp_mask);
Joonsoo Kime2cfc912015-07-17 16:24:18 -070011extern gfp_t __get_page_owner_gfp(struct page *page);
Joonsoo Kim48c96a32014-12-12 16:56:01 -080012
13static 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
21static 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 Kime2cfc912015-07-17 16:24:18 -070029
30static 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 Kim48c96a32014-12-12 16:56:01 -080037#else
38static inline void reset_page_owner(struct page *page, unsigned int order)
39{
40}
41static inline void set_page_owner(struct page *page,
42 unsigned int order, gfp_t gfp_mask)
43{
44}
Joonsoo Kime2cfc912015-07-17 16:24:18 -070045static inline gfp_t get_page_owner_gfp(struct page *page)
46{
47 return 0;
48}
Joonsoo Kim48c96a32014-12-12 16:56:01 -080049
50#endif /* CONFIG_PAGE_OWNER */
51#endif /* __LINUX_PAGE_OWNER_H */