[2/2] net: fix compilation with !CONFIG_NET

Message ID 1324032720-13752-2-git-send-email-glommer@parallels.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Glauber Costa Dec. 16, 2011, 10:52 a.m.
Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Glauber Costa <glommer@parallels.com>
CC: Hiroyouki Kamezawa <kamezawa.hiroyu@jp.fujitsu.com>
CC: David S. Miller <davem@davemloft.net>
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: Stephen Rothwell <sfr@canb.auug.org.au>
 include/net/sock.h |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)


David Miller Dec. 16, 2011, 8:35 p.m. | #1
From: Glauber Costa <glommer@parallels.com>
Date: Fri, 16 Dec 2011 14:52:00 +0400

> Reported-by: Randy Dunlap <rdunlap@xenotime.net>
> Signed-off-by: Glauber Costa <glommer@parallels.com>

To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


diff --git a/include/net/sock.h b/include/net/sock.h
index 6fe0dae..3144c79 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -66,8 +66,20 @@ 
 struct cgroup;
 struct cgroup_subsys;
+#ifdef CONFIG_NET
 int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgroup_subsys *ss);
 void mem_cgroup_sockets_destroy(struct cgroup *cgrp, struct cgroup_subsys *ss);
+static inline
+int mem_cgroup_sockets_init(struct cgroup *cgrp, struct cgroup_subsys *ss)
+	return 0;
+static inline
+void mem_cgroup_sockets_destroy(struct cgroup *cgrp, struct cgroup_subsys *ss)
  * This structure really needs to be cleaned up.
  * Most of it is for TCP, and not used by any of