From 89bd02022cdbec31de944d0335cb40fdcc9a07a1 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Sun, 15 Jan 2012 22:04:39 +0000 Subject: [PATCH] net: move sock_update_memcg outside of CONFIG_INET Although only used currently for tcp sockets, this function is now used in common sock code (for sock_clone()) Commit b48facb4ca963634facbd03cbc6aa04aeed825c9 moved the declaration of sock_update_clone() to inside sock.c, but this only fixes the problem when CONFIG_CGROUP_MEM_RES_CTLR_KMEM is also not defined. This patch here is verified to fix both problems, although reverting the previous one is not necessary. Signed-off-by: Glauber Costa CC: David S. Miller CC: Stephen Rothwell Reported-by: Randy Dunlap Acked-by: Randy Dunlap Signed-off-by: David S. Miller --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 602207be98537..3dbff4dcde351 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -373,7 +373,6 @@ static void mem_cgroup_put(struct mem_cgroup *memcg); /* Writing them here to avoid exposing memcg's inner layout */ #ifdef CONFIG_CGROUP_MEM_RES_CTLR_KMEM -#ifdef CONFIG_INET #include #include @@ -420,6 +419,7 @@ void sock_release_memcg(struct sock *sk) } } +#ifdef CONFIG_INET struct cg_proto *tcp_proto_cgroup(struct mem_cgroup *memcg) { if (!memcg || mem_cgroup_is_root(memcg)) -- 2.39.5