diff options
Diffstat (limited to 'include/linux/memcontrol.h')
| -rw-r--r-- | include/linux/memcontrol.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 7d1f119c796e..f5b47efab48b 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
| @@ -30,6 +30,13 @@ extern void mm_free_cgroup(struct mm_struct *mm); | |||
| 30 | extern void page_assign_page_cgroup(struct page *page, | 30 | extern void page_assign_page_cgroup(struct page *page, |
| 31 | struct page_cgroup *pc); | 31 | struct page_cgroup *pc); |
| 32 | extern struct page_cgroup *page_get_page_cgroup(struct page *page); | 32 | extern struct page_cgroup *page_get_page_cgroup(struct page *page); |
| 33 | extern int mem_cgroup_charge(struct page *page, struct mm_struct *mm); | ||
| 34 | extern void mem_cgroup_uncharge(struct page_cgroup *pc); | ||
| 35 | |||
| 36 | static inline void mem_cgroup_uncharge_page(struct page *page) | ||
| 37 | { | ||
| 38 | mem_cgroup_uncharge(page_get_page_cgroup(page)); | ||
| 39 | } | ||
| 33 | 40 | ||
| 34 | #else /* CONFIG_CGROUP_MEM_CONT */ | 41 | #else /* CONFIG_CGROUP_MEM_CONT */ |
| 35 | static inline void mm_init_cgroup(struct mm_struct *mm, | 42 | static inline void mm_init_cgroup(struct mm_struct *mm, |
| @@ -51,6 +58,19 @@ static inline struct page_cgroup *page_get_page_cgroup(struct page *page) | |||
| 51 | return NULL; | 58 | return NULL; |
| 52 | } | 59 | } |
| 53 | 60 | ||
| 61 | static inline int mem_cgroup_charge(struct page *page, struct mm_struct *mm) | ||
| 62 | { | ||
| 63 | return 0; | ||
| 64 | } | ||
| 65 | |||
| 66 | static inline void mem_cgroup_uncharge(struct page_cgroup *pc) | ||
| 67 | { | ||
| 68 | } | ||
| 69 | |||
| 70 | static inline void mem_cgroup_uncharge_page(struct page *page) | ||
| 71 | { | ||
| 72 | } | ||
| 73 | |||
| 54 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 74 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
| 55 | 75 | ||
| 56 | #endif /* _LINUX_MEMCONTROL_H */ | 76 | #endif /* _LINUX_MEMCONTROL_H */ |
