]> Git Repo - linux.git/commitdiff
memcg, kmem: fix build error when CONFIG_INET is disabled
authorDavid Rientjes <[email protected]>
Wed, 10 Oct 2012 22:54:08 +0000 (15:54 -0700)
committerLinus Torvalds <[email protected]>
Wed, 10 Oct 2012 23:50:16 +0000 (08:50 +0900)
Commit e1aab161e013 ("socket: initial cgroup code.") causes a build
error when CONFIG_INET is disabled in Linus' tree:

  net/built-in.o: In function `sk_update_clone':
  net/core/sock.c:1336: undefined reference to `sock_update_memcg'

sock_update_memcg() is only defined when CONFIG_INET is enabled, so fix
it by defining the dummy function without this option.

Signed-off-by: David Rientjes <[email protected]>
Reported-by: Randy Dunlap <[email protected]>
Cc: Glauber Costa <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Fengguang Wu <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/memcontrol.h

index fd0e6d53836ee5f0064cdce06ed06959b0ba1f8e..11ddc7ffeba88972f21937a8b45d65191d40fc35 100644 (file)
@@ -396,7 +396,7 @@ enum {
 };
 
 struct sock;
-#ifdef CONFIG_MEMCG_KMEM
+#if defined(CONFIG_INET) && defined(CONFIG_MEMCG_KMEM)
 void sock_update_memcg(struct sock *sk);
 void sock_release_memcg(struct sock *sk);
 #else
@@ -406,6 +406,6 @@ static inline void sock_update_memcg(struct sock *sk)
 static inline void sock_release_memcg(struct sock *sk)
 {
 }
-#endif /* CONFIG_MEMCG_KMEM */
+#endif /* CONFIG_INET && CONFIG_MEMCG_KMEM */
 #endif /* _LINUX_MEMCONTROL_H */
 
This page took 0.060734 seconds and 4 git commands to generate.