memcontrol: move mm_cgroup to header file
Inline functions must preceed their use, so mm_cgroup() should be defined in linux/memcontrol.h. include/linux/memcontrol.h:48: warning: 'mm_cgroup' declared inline after being called include/linux/memcontrol.h:48: warning: previous declaration of 'mm_cgroup' was here [akpm@linux-foundation.org: build fix] [akpm@linux-foundation.org: nuther build fix] Cc: Balbir Singh <balbir@linux.vnet.ibm.com> Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
e1a1cd590e
commit
3062fc67da
@@ -20,6 +20,9 @@
|
|||||||
#ifndef _LINUX_MEMCONTROL_H
|
#ifndef _LINUX_MEMCONTROL_H
|
||||||
#define _LINUX_MEMCONTROL_H
|
#define _LINUX_MEMCONTROL_H
|
||||||
|
|
||||||
|
#include <linux/rcupdate.h>
|
||||||
|
#include <linux/mm.h>
|
||||||
|
|
||||||
struct mem_cgroup;
|
struct mem_cgroup;
|
||||||
struct page_cgroup;
|
struct page_cgroup;
|
||||||
struct page;
|
struct page;
|
||||||
@@ -45,7 +48,11 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
|
|||||||
extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
|
extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
|
||||||
extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
|
extern int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
|
||||||
gfp_t gfp_mask);
|
gfp_t gfp_mask);
|
||||||
extern struct mem_cgroup *mm_cgroup(struct mm_struct *mm);
|
|
||||||
|
static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm)
|
||||||
|
{
|
||||||
|
return rcu_dereference(mm->mem_cgroup);
|
||||||
|
}
|
||||||
|
|
||||||
static inline void mem_cgroup_uncharge_page(struct page *page)
|
static inline void mem_cgroup_uncharge_page(struct page *page)
|
||||||
{
|
{
|
||||||
@@ -98,7 +105,7 @@ static inline int mem_cgroup_cache_charge(struct page *page,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline struct mem_cgroup *mm_cgroup(struct mm_struct *mm)
|
static inline struct mem_cgroup *mm_cgroup(const struct mm_struct *mm)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@@ -110,11 +110,6 @@ struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p)
|
|||||||
struct mem_cgroup, css);
|
struct mem_cgroup, css);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline struct mem_cgroup *mm_cgroup(struct mm_struct *mm)
|
|
||||||
{
|
|
||||||
return rcu_dereference(mm->mem_cgroup);
|
|
||||||
}
|
|
||||||
|
|
||||||
void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p)
|
void mm_init_cgroup(struct mm_struct *mm, struct task_struct *p)
|
||||||
{
|
{
|
||||||
struct mem_cgroup *mem;
|
struct mem_cgroup *mem;
|
||||||
|
Reference in New Issue
Block a user