blob: b48c3471c254471ed940921ab7bb4832d6f92023 [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);
11
12static 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
20static 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
29static inline void reset_page_owner(struct page *page, unsigned int order)
30{
31}
32static 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 */