net: move sock_update_memcg outside of CONFIG_INET
authorGlauber Costa <[email protected]>
Sun, 15 Jan 2012 22:04:39 +0000 (22:04 +0000)
committerDavid S. Miller <[email protected]>
Tue, 17 Jan 2012 15:15:45 +0000 (10:15 -0500)
Although only used currently for tcp sockets, this function
is now used in common sock code (for sock_clone())

Commit 475f1b52645a29936b9df1d8fcd45f7e56bd4a9f 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 <[email protected]>
CC: David S. Miller <[email protected]>
CC: Stephen Rothwell <[email protected]>
Reported-by: Randy Dunlap <[email protected]>
Acked-by: Randy Dunlap <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
mm/memcontrol.c

index 602207be985379f7e15e94ea546b8d70b0b2a7b9..3dbff4dcde35191a62b0245ac7ee185bc8fc7084 100644 (file)
@@ -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 <net/sock.h>
 #include <net/ip.h>
 
@@ -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))