[Devel] [PATCH COMMIT] diff-ve-inkernel-compilation
xemul at sw.ru
xemul at sw.ru
Wed Apr 5 05:44:05 PDT 2006
Added to 026test008
Patch from OpenVZ team <devel at openvz.org>
This patch fixes comilation with CONFIG_MODULES=n
-------------- next part --------------
--- linux-2.6.8-openvz-022.064.orig/include/linux/nfcalls.h 2006-02-13 14:55:28.000000000 +0100
+++ linux-2.6.8-openvz-022.064/include/linux/nfcalls.h 2006-02-13 14:56:33.000000000 +0100
@@ -13,6 +13,7 @@
#include <linux/rcupdate.h>
+#ifdef CONFIG_MODULES
extern struct module no_module;
#define DECL_KSYM_MODULE(name) \
@@ -45,6 +46,15 @@
__vzksym_module_put(vz_mod_##mod); \
} \
} while (0)
+#else
+#define DECL_KSYM_CALL(type, name, args) \
+ extern type name args
+#define INIT_KSYM_MODULE(name)
+#define INIT_KSYM_CALL(type, name, args) \
+ type name args
+#define __KSYMERRCALL(err, type, mod, name, args) ((*name)args)
+#define __KSYMSAFECALL_VOID(mod, name, args) ((*name)args)
+#endif
#define KSYMERRCALL(err, mod, name, args) \
__KSYMERRCALL(err, int, mod, name, args)
@@ -53,7 +63,7 @@
#define KSYMSAFECALL_VOID(mod, name, args) \
__KSYMSAFECALL_VOID(mod, name, args)
-#ifdef CONFIG_VE
+#if defined(CONFIG_VE) && defined(CONFIG_MODULES)
/* should be called _after_ KSYMRESOLVE's */
#define KSYMMODRESOLVE(name) \
__vzksym_modresolve(&vz_mod_##name, THIS_MODULE)
@@ -71,6 +81,7 @@
#define KSYMMODUNRESOLVE(name) do { } while (0)
#endif
+#ifdef CONFIG_MODULES
static inline void __vzksym_modresolve(struct module **modp, struct module *mod)
{
/*
@@ -118,8 +129,10 @@
{
module_put(mod);
}
+#endif
#if defined(CONFIG_VE_IPTABLES)
+#ifdef CONFIG_MODULES
DECL_KSYM_MODULE(x_tables);
DECL_KSYM_MODULE(ip_tables);
DECL_KSYM_MODULE(iptable_filter);
@@ -142,6 +155,7 @@
DECL_KSYM_MODULE(ip_nat_ftp);
DECL_KSYM_MODULE(ip_nat_irc);
DECL_KSYM_MODULE(ipt_REDIRECT);
+#endif
struct sk_buff;
--- linux-2.6.8-openvz-022.064.orig/include/linux/ve.h 2006-02-13 14:55:24.000000000 +0100
+++ linux-2.6.8-openvz-022.064/include/linux/ve.h 2006-02-13 14:56:24.000000000 +0100
@@ -273,13 +273,6 @@
#ifdef CONFIG_VE
-#ifdef CONFIG_VE_CALLS
-#define get_device_perms_ve real_get_device_perms_ve
-#define do_env_cleanup real_do_env_cleanup
-#define do_env_free real_do_env_free
-#define do_update_load_avg_ve real_update_load_avg_ve
-#endif
-
int get_device_perms_ve(int dev_type, dev_t dev, int access_mode);
void do_env_cleanup(struct ve_struct *envid);
void do_update_load_avg_ve(void);
--- linux-2.6.8-openvz-022.064.orig/include/linux/ve_proto.h 2006-02-13 14:55:25.000000000 +0100
+++ linux-2.6.8-openvz-022.064/include/linux/ve_proto.h 2006-02-13 14:56:33.000000000 +0100
@@ -49,23 +49,6 @@
extern int do_setdevperms(envid_t veid, unsigned type,
dev_t dev, unsigned mask);
-#ifdef CONFIG_VE_IPTABLES
-extern int init_netfilter(void);
-extern int init_iptables(void);
-extern int init_iptable_filter(void);
-extern int init_iptable_limit(void);
-extern int init_iptable_multiport(void);
-extern int init_iptable_tos(void);
-extern int init_iptable_REJECT(void);
-extern void fini_netfilter(void);
-extern int fini_iptables(void);
-extern int fini_iptable_filter(void);
-extern int fini_iptable_limit(void);
-extern int fini_iptable_multiport(void);
-extern int fini_iptable_tos(void);
-extern int fini_iptable_REJECT(void);
-#endif
-
#define VE_HOOK_INIT 0
#define VE_HOOK_FINI 1
#define VE_MAX_HOOKS 2
--- linux-2.6.8-openvz-022.064.orig/kernel/ve.c 2006-02-13 14:55:16.000000000 +0100
+++ linux-2.6.8-openvz-022.064/kernel/ve.c 2006-02-13 21:38:16.000000000 +0100
@@ -39,8 +39,10 @@
unsigned long vz_rstamp = 0x37e0f59d;
+#ifdef CONFIG_MODULES
struct module no_module = { .state = MODULE_STATE_GOING };
EXPORT_SYMBOL(no_module);
+#endif
#ifdef CONFIG_VE
@@ -124,7 +126,7 @@
INIT_KSYM_CALL(void, ipt_flush_table, (struct xt_table *table));
#endif
-#ifdef CONFIG_VE_CALLS_MODULE
+#if defined(CONFIG_VE_CALLS_MODULE) || defined(CONFIG_VE_CALLS)
INIT_KSYM_MODULE(vzmon);
INIT_KSYM_CALL(int, real_get_device_perms_ve,
(int dev_type, dev_t dev, int access_mode));
--- ./kernel/vecalls.c.wfix 2006-03-03 16:15:58.000000000 +0300
+++ ./kernel/vecalls.c 2006-03-03 16:16:06.000000000 +0300
@@ -1380,6 +1380,8 @@ static void move_task(struct task_struct
#if (defined(CONFIG_VE_NETDEV) || defined(CONFIG_VE_NETDEV_MODULE)) && \
defined(CONFIG_NETFILTER) && defined(CONFIG_VE_IPTABLES)
+extern int init_netfilter(void);
+extern void fini_netfilter(void);
#define init_ve_netfilter() init_netfilter()
#define fini_ve_netfilter() fini_netfilter()
#else
--- linux-2.6.8-openvz-022.064.orig/net/ipv4/netfilter/iptable_mangle.c 2006-02-13 14:54:08.000000000 +0100
+++ linux-2.6.8-openvz-022.064/net/ipv4/netfilter/iptable_mangle.c 2006-02-13 14:56:45.000000000 +0100
@@ -285,12 +285,12 @@
#endif
}
-static int init_iptable_mangle(void)
+int init_iptable_mangle(void)
{
return mangle_init(ipt_ops);
}
-static void fini_iptable_mangle(void)
+void fini_iptable_mangle(void)
{
mangle_fini(ipt_ops);
}
More information about the Devel
mailing list