[Devel] [RFC 15/54] meminfo: fix CONFIG_VE=n build
Eva Kurchatova
eva.kurchatova at virtuozzo.com
Wed Apr 29 22:58:15 MSK 2026
Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>
---
fs/proc/meminfo.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/fs/proc/meminfo.c b/fs/proc/meminfo.c
index e7ee7225fcae..38fcbf8abde5 100644
--- a/fs/proc/meminfo.c
+++ b/fs/proc/meminfo.c
@@ -34,6 +34,7 @@ static void show_val_kb(struct seq_file *m, const char *s, unsigned long num)
seq_write(m, " kB\n", 4);
}
+#ifdef CONFIG_VE
static int meminfo_proc_show_mi(struct seq_file *m, struct meminfo *mi)
{
unsigned long *pages;
@@ -84,12 +85,12 @@ static void fill_meminfo_ve(struct meminfo *mi, struct ve_struct *ve)
css_put(css);
}
+#endif
static int meminfo_proc_show_ve(struct seq_file *m, void *v,
struct ve_struct *ve)
{
struct sysinfo i;
- struct meminfo mi;
unsigned long committed;
long cached;
long available;
@@ -100,15 +101,17 @@ static int meminfo_proc_show_ve(struct seq_file *m, void *v,
si_meminfo(&i);
si_swapinfo(&i);
- memset(&mi, 0, sizeof(mi));
- mi.si = &i;
- mi.ve = ve;
-
+#ifdef CONFIG_VE
if (!ve_is_super(ve) && ve->meminfo_val == VE_MEMINFO_DEFAULT) {
+ struct meminfo mi;
+ memset(&mi, 0, sizeof(mi));
+ mi.si = &i;
+ mi.ve = ve;
fill_meminfo_ve(&mi, ve);
return meminfo_proc_show_mi(m, &mi);
}
+#endif
committed = vm_memory_committed();
--
2.54.0
More information about the Devel
mailing list