linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch -mm 6/5] memcontrol: move mm_cgroup to header file
@ 2007-09-25 17:13 David Rientjes
  2007-09-25 17:13 ` [patch -mm 7/5] oom: filter tasklist dump by mem_cgroup David Rientjes
  2007-09-25 17:18 ` [patch -mm 6/5] memcontrol: move mm_cgroup to header file Balbir Singh
  0 siblings, 2 replies; 19+ messages in thread
From: David Rientjes @ 2007-09-25 17:13 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Balbir Singh, linux-mm

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

Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
Signed-off-by: David Rientjes <rientjes@google.com>
---
 include/linux/memcontrol.h |    8 ++++++--
 mm/memcontrol.c            |    5 -----
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -45,7 +45,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 int mem_cgroup_cache_charge(struct page *page, struct mm_struct *mm,
 					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)
 {
@@ -108,7 +112,7 @@ static inline int mem_cgroup_cache_charge(struct page *page,
 	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;
 }
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -110,11 +110,6 @@ struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p)
 				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)
 {
 	struct mem_cgroup *mem;

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2007-09-26  4:37 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-25 17:13 [patch -mm 6/5] memcontrol: move mm_cgroup to header file David Rientjes
2007-09-25 17:13 ` [patch -mm 7/5] oom: filter tasklist dump by mem_cgroup David Rientjes
2007-09-25 17:48   ` Balbir Singh
2007-09-25 19:18     ` David Rientjes
2007-09-25 18:00   ` Paul Menage
2007-09-25 21:17     ` Christoph Lameter
2007-09-25 22:54       ` Paul Menage
2007-09-26  1:14     ` Paul Jackson
2007-09-26  1:20       ` David Rientjes
2007-09-26  3:56         ` Paul Jackson
2007-09-26  4:14           ` David Rientjes
2007-09-26  4:24             ` David Rientjes
2007-09-26  4:37             ` Paul Jackson
2007-09-26  1:22       ` Paul Menage
2007-09-26  3:57         ` Paul Jackson
2007-09-26  4:03           ` Paul Menage
2007-09-26  4:30             ` Paul Jackson
2007-09-25 17:18 ` [patch -mm 6/5] memcontrol: move mm_cgroup to header file Balbir Singh
2007-09-25 18:49   ` David Rientjes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox