]> bbs.cooldavid.org Git - net-next-2.6.git/commit - kernel/sysctl.c
sysctl: Add register_sysctl_paths function
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 30 Nov 2007 12:50:18 +0000 (23:50 +1100)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:55:16 +0000 (14:55 -0800)
commit29e796fd4de54b8f5bc30d897611210ece4fd0f2
treea05b5e87e7b6c4d1820d892c4aabc438ccee58e5
parentbe0ea7d5da3d99140bde7e5cea328eb111731700
sysctl: Add register_sysctl_paths function

There are a number of modules that register a sysctl table
somewhere deeply nested in the sysctl hierarchy, such as
fs/nfs, fs/xfs, dev/cdrom, etc.

They all specify several dummy ctl_tables for the path name.
This patch implements register_sysctl_path that takes
an additional path name, and makes up dummy sysctl nodes
for each component.

This patch was originally written by Olaf Kirch and
brought to my attention and reworked some by Olaf Hering.
I have changed a few additional things so the bugs are mine.

After converting all of the easy callers Olaf Hering observed
allyesconfig ARCH=i386, the patch reduces the final binary size by 9369 bytes.

.text +897
.data -7008

   text    data     bss     dec     hex filename
   26959310        4045899 4718592 35723801        2211a19 ../vmlinux-vanilla
   26960207        4038891 4718592 35717690        221023a ../O-allyesconfig/vmlinux

So this change is both a space savings and a code simplification.

CC: Olaf Kirch <okir@suse.de>
CC: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Serge Hallyn <serue@us.ibm.com>
Cc: Daniel Lezcano <dlezcano@fr.ibm.com>
Cc: Cedric Le Goater <clg@fr.ibm.com>
Cc: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/sysctl.h
kernel/sysctl.c