aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMichal Hocko <mhocko@suse.cz>2012-10-08 19:33:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-09 03:22:55 -0400
commit7ffc0edc49d0df5dac077c1830e2533b27d3a4ed (patch)
treed3a9b21a5725af5a678eb0d2d07a3848bbf65fd4 /mm
parent4bd2c1ee4b439d926e437a4841e8145230df98c9 (diff)
memcg: move mem_cgroup_is_root upwards
kmem code uses this function and it is better to not use forward declarations for static inline functions as some (older) compilers don't like it: gcc version 4.3.4 [gcc-4_3-branch revision 152973] (SUSE Linux) mm/memcontrol.c:421: warning: `mem_cgroup_is_root' declared inline after being called mm/memcontrol.c:421: warning: previous declaration of `mem_cgroup_is_root' was here Signed-off-by: Michal Hocko <mhocko@suse.cz> Cc: Glauber Costa <glommer@parallels.com> Cc: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memcontrol.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 4f5f93657246..7acf43bf04a2 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -412,10 +412,14 @@ struct mem_cgroup *mem_cgroup_from_css(struct cgroup_subsys_state *s)
412 return container_of(s, struct mem_cgroup, css); 412 return container_of(s, struct mem_cgroup, css);
413} 413}
414 414
415static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg)
416{
417 return (memcg == root_mem_cgroup);
418}
419
415/* Writing them here to avoid exposing memcg's inner layout */ 420/* Writing them here to avoid exposing memcg's inner layout */
416#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM) 421#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM)
417 422
418static bool mem_cgroup_is_root(struct mem_cgroup *memcg);
419void sock_update_memcg(struct sock *sk) 423void sock_update_memcg(struct sock *sk)
420{ 424{
421 if (mem_cgroup_sockets_enabled) { 425 if (mem_cgroup_sockets_enabled) {
@@ -1011,11 +1015,6 @@ void mem_cgroup_iter_break(struct mem_cgroup *root,
1011 iter != NULL; \ 1015 iter != NULL; \
1012 iter = mem_cgroup_iter(NULL, iter, NULL)) 1016 iter = mem_cgroup_iter(NULL, iter, NULL))
1013 1017
1014static inline bool mem_cgroup_is_root(struct mem_cgroup *memcg)
1015{
1016 return (memcg == root_mem_cgroup);
1017}
1018
1019void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx) 1018void mem_cgroup_count_vm_event(struct mm_struct *mm, enum vm_event_item idx)
1020{ 1019{
1021 struct mem_cgroup *memcg; 1020 struct mem_cgroup *memcg;