From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Balbir Singh <balbir@linux.vnet.ibm.com>, linux-mm@kvack.org
Subject: [patch -mm 6/5] memcontrol: move mm_cgroup to header file
Date: Tue, 25 Sep 2007 10:13:14 -0700 (PDT) [thread overview]
Message-ID: <alpine.DEB.0.9999.0709250035570.11015@chino.kir.corp.google.com> (raw)
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>
next reply other threads:[~2007-09-25 17:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-25 17:13 David Rientjes [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.0.9999.0709250035570.11015@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=balbir@linux.vnet.ibm.com \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox