[Devel] [PATCH RHEL9 COMMIT] ve: fixes for !CONFIG_VE case
Konstantin Khorenko
khorenko at virtuozzo.com
Thu Nov 11 21:04:06 MSK 2021
The commit is pushed to "branch-rh9-5.14.vz9.1.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-4.vz9.10.25
------>
commit 48d078076879ae113af6ab5d25393a1ad6742d22
Author: Nikita Yushchenko <nikita.yushchenko at virtuozzo.com>
Date: Thu Nov 11 21:04:06 2021 +0300
ve: fixes for !CONFIG_VE case
Avoid several compile errors if CONFIG_VE is not defined.
To_merge: to find proper places
Signed-off-by: Nikita Yushchenko <nikita.yushchenko at virtuozzo.com>
---
include/linux/ve.h | 5 +++--
include/linux/ve_proto.h | 1 +
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/linux/ve.h b/include/linux/ve.h
index 79717884d2b8..4c8f7d308829 100644
--- a/include/linux/ve.h
+++ b/include/linux/ve.h
@@ -223,8 +223,9 @@ int ve_net_hide_sysctl(struct net *net);
extern struct net *ve_get_net_ns(struct ve_struct* ve);
#else /* CONFIG_VE */
-#define get_ve(ve) (NULL)
-#define put_ve(ve) do { } while (0)
+#include <linux/init_task.h>
+#define get_ve(ve) ((void)(ve), NULL)
+#define put_ve(ve) do { (void)(ve); } while (0)
static inline void ve_stop_ns(struct pid_namespace *ns) { }
static inline void ve_exit_ns(struct pid_namespace *ns) { }
diff --git a/include/linux/ve_proto.h b/include/linux/ve_proto.h
index 7ec73cfe3dd7..d7b613f7d26d 100644
--- a/include/linux/ve_proto.h
+++ b/include/linux/ve_proto.h
@@ -78,6 +78,7 @@ extern void ve_hook_register(int chain, struct ve_hook *vh);
extern void ve_hook_unregister(struct ve_hook *vh);
extern int nr_threads_ve(struct ve_struct *ve);
#else /* CONFIG_VE */
+#include <linux/sched/stat.h>
#define ve_hook_register(ch, vh) do { } while (0)
#define ve_hook_unregister(ve) do { } while (0)
More information about the Devel
mailing list