[Devel] [RFC 22/54] sysctl: fix CONFIG_VE=n build

Eva Kurchatova eva.kurchatova at virtuozzo.com
Wed Apr 29 22:58:22 MSK 2026


Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
---
 include/linux/sysctl.h | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 2fab3ecfaf88..94d99ab7d0c3 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -89,6 +89,8 @@ int proc_do_static_key(const struct ctl_table *table, int write, void *buffer,
 		size_t *lenp, loff_t *ppos);
 
 bool virtual_ptr(void **ptr, void *base, size_t size, void *cur);
+
+#ifdef CONFIG_VE
 #define sysctl_virtual(sysctl)							\
 int sysctl ## _virtual(const struct ctl_table *table, int write,		\
 		        void *buffer, size_t *lenp, loff_t *ppos)		\
@@ -98,6 +100,14 @@ int sysctl ## _virtual(const struct ctl_table *table, int write,		\
 		return sysctl(&tmp, write, buffer, lenp, ppos);			\
 	return -EINVAL;								\
 }
+#else
+#define sysctl_virtual(sysctl)							\
+int sysctl ## _virtual(const struct ctl_table *table, int write,		\
+void *buffer, size_t *lenp, loff_t *ppos)		\
+{										\
+	return sysctl(table, write, buffer, lenp, ppos);			\
+}
+#endif
 
 extern int proc_dointvec_virtual(const struct ctl_table *table, int write,
 		void *buffer, size_t *lenp, loff_t *ppos);
-- 
2.54.0



More information about the Devel mailing list