2003-02-17 10:49:05

by Miles Bader

[permalink] [raw]
Subject: [PATCH] Make sysctl vm subdir dependent on CONFIG_MMU

diff -ruN -X../cludes linux-2.5.61-uc0.orig/kernel/sysctl.c linux-2.5.61-uc0/kernel/sysctl.c
--- linux-2.5.61-uc0.orig/kernel/sysctl.c 2002-12-16 12:53:59.000000000 +0900
+++ linux-2.5.61-uc0/kernel/sysctl.c 2003-02-17 19:24:58.000000000 +0900
@@ -111,7 +111,9 @@
{ root_table, LIST_HEAD_INIT(root_table_header.ctl_entry) };

static ctl_table kern_table[];
+#ifdef CONFIG_MMU
static ctl_table vm_table[];
+#endif
#ifdef CONFIG_NET
extern ctl_table net_table[];
#endif
@@ -148,7 +150,9 @@

static ctl_table root_table[] = {
{CTL_KERN, "kernel", NULL, 0, 0555, kern_table},
+#ifdef CONFIG_MMU
{CTL_VM, "vm", NULL, 0, 0555, vm_table},
+#endif
#ifdef CONFIG_NET
{CTL_NET, "net", NULL, 0, 0555, net_table},
#endif
@@ -271,6 +275,7 @@
static int one_hundred = 100;


+#ifdef CONFIG_MMU
static ctl_table vm_table[] = {
{VM_OVERCOMMIT_MEMORY, "overcommit_memory", &sysctl_overcommit_memory,
sizeof(sysctl_overcommit_memory), 0644, NULL, &proc_dointvec},
@@ -321,6 +326,7 @@
NULL, },
{0}
};
+#endif /* CONFIG_MMU */

static ctl_table proc_table[] = {
{0}


2003-02-17 12:45:16

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] Make sysctl vm subdir dependent on CONFIG_MMU

On Mon, Feb 17, 2003 at 07:59:00PM +0900, Miles Bader wrote:
> diff -ruN -X../cludes linux-2.5.61-uc0.orig/kernel/sysctl.c linux-2.5.61-uc0/kernel/sysctl.c
> --- linux-2.5.61-uc0.orig/kernel/sysctl.c 2002-12-16 12:53:59.000000000 +0900
> +++ linux-2.5.61-uc0/kernel/sysctl.c 2003-02-17 19:24:58.000000000 +0900
> @@ -111,7 +111,9 @@
> { root_table, LIST_HEAD_INIT(root_table_header.ctl_entry) };
>
> static ctl_table kern_table[];
> +#ifdef CONFIG_MMU
> static ctl_table vm_table[];
> +#endif

These ifdefs are ugly - please move the whole table into a file that
isn't compiled when CONFIG_MMU isn't set (e.g. memory.c) and use
register_sysctl_table()

2003-02-17 14:01:54

by Miles Bader

[permalink] [raw]
Subject: Re: [PATCH] Make sysctl vm subdir dependent on CONFIG_MMU

On Mon, Feb 17, 2003 at 12:55:04PM +0000, Christoph Hellwig wrote:
> These ifdefs are ugly - please move the whole table into a file that
> isn't compiled when CONFIG_MMU isn't set (e.g. memory.c) and use
> register_sysctl_table()

Hmm, somehow I thought you were going to say that ... :-)

Either way is OK with me, but note that I just followed the style already
used in sysctl.c for CONFIG_NET.

-Miles
--
Saa, shall we dance? (from a dance-class advertisement)

2003-02-17 14:36:47

by Christoph Hellwig

[permalink] [raw]
Subject: Re: [PATCH] Make sysctl vm subdir dependent on CONFIG_MMU

On Mon, Feb 17, 2003 at 09:09:44AM -0500, Miles Bader wrote:
> Either way is OK with me, but note that I just followed the style already
> used in sysctl.c for CONFIG_NET.

Looks like I need to fix up that bad example :)