[Devel] [PATCH RHEL7 COMMIT] bc/net.h: don't define CONFIG_BEANCOUNTERS if undefined
Konstantin Khorenko
khorenko at odin.com
Thu May 7 09:28:06 PDT 2015
The commit is pushed to "branch-rh7-3.10.0-123.1.2-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-123.1.2.vz7.4.10
------>
commit d2036c1302ae10a427d0bfdf22c2e1f8eb692041
Author: Kir Kolyshkin <kir at openvz.org>
Date: Thu May 7 20:28:05 2015 +0400
bc/net.h: don't define CONFIG_BEANCOUNTERS if undefined
This was found while tring to compile the kernel with a stock
config (i.e. no CONFIG_BEANCOUNTERS, CONFIG_VE etc.) and
boot it on IBM Power8.
=============================================================
This is pretty ugly, but without this patch CONFIG_BEANCOUNTERS
appears as defined even it's not in .config, that leads to the
following error (and who knows what else):
CC kernel/cgroup.o
include/linux/cgroup_subsys.h:95:8: error: âub_subsys_idâ undeclared here (not in a function)
SUBSYS(ub)
^
kernel/cgroup.c:108:21: note: in definition of macro âSUBSYSâ
#define SUBSYS(_x) [_x ## _subsys_id] = &_x ## _subsys,
^
In file included from kernel/cgroup.c:111:0:
include/linux/cgroup_subsys.h:95:1: error: array index in initializer not of integer type
SUBSYS(ub)
^
include/linux/cgroup_subsys.h:95:1: error: (near initialization for âsubsysâ)
include/linux/cgroup_subsys.h:95:8: error: âub_subsysâ undeclared here (not in a function)
SUBSYS(ub)
^
kernel/cgroup.c:108:42: note: in definition of macro âSUBSYSâ
#define SUBSYS(_x) [_x ## _subsys_id] = &_x ## _subsys,
^
make[1]: *** [kernel/cgroup.o] Error 1
Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
include/bc/net.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/include/bc/net.h b/include/bc/net.h
index 90e57a1..e0fb572 100644
--- a/include/bc/net.h
+++ b/include/bc/net.h
@@ -18,7 +18,10 @@
#include <bc/sock.h>
#include <bc/beancounter.h>
+#ifdef CONFIG_BEANCOUNTERS
#undef CONFIG_BEANCOUNTERS
+#define CONFIG_BEANCOUNTERS_WILL_BE_BACK
+#endif
#undef __BC_DECL_H_
#undef UB_DECLARE_FUNC
#undef UB_DECLARE_VOID_FUNC
@@ -213,7 +216,10 @@ UB_DECLARE_VOID_FUNC(ub_skb_set_charge(struct sk_buff *skb,
struct sock *sk, unsigned long size, int res))
UB_DECLARE_FUNC(int, __ub_too_many_orphans(struct sock *sk, int count))
+#ifdef CONFIG_BEANCOUNTERS_WILL_BE_BACK
#define CONFIG_BEANCOUNTERS 1
+#undef CONFIG_BEANCOUNTERS_WILL_BE_BACK
+#endif
#undef __BC_DECL_H_
#undef UB_DECLARE_FUNC
#undef UB_DECLARE_VOID_FUNC
More information about the Devel
mailing list