Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] sysctl: implement CTL_UNNUMBERED

This patch takes the CTL_UNNUMBERD concept from NFS and makes it available to
all new sysctl users.

At the same time the sysctl binary interface maintenance documentation is
updated to mention and to describe what is needed to successfully maintain the
sysctl binary interface.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Eric W. Biederman and committed by
Linus Torvalds
7cc13edc d99f160a

+11 -11
-3
fs/lockd/svc.c
··· 353 353 * Sysctl parameters (same as module parameters, different interface). 354 354 */ 355 355 356 - /* Something that isn't CTL_ANY, CTL_NONE or a value that may clash. */ 357 - #define CTL_UNNUMBERED -2 358 - 359 356 static ctl_table nlm_sysctls[] = { 360 357 { 361 358 .ctl_name = CTL_UNNUMBERED,
-5
fs/nfs/sysctl.c
··· 18 18 static const int nfs_set_port_min = 0; 19 19 static const int nfs_set_port_max = 65535; 20 20 static struct ctl_table_header *nfs_callback_sysctl_table; 21 - /* 22 - * Something that isn't CTL_ANY, CTL_NONE or a value that may clash. 23 - * Use the same values as fs/lockd/svc.c 24 - */ 25 - #define CTL_UNNUMBERED -2 26 21 27 22 static ctl_table nfs_cb_sysctls[] = { 28 23 #ifdef CONFIG_NFS_V4
+11 -3
include/linux/sysctl.h
··· 6 6 **************************************************************** 7 7 **************************************************************** 8 8 ** 9 + ** WARNING: 9 10 ** The values in this file are exported to user space via 10 - ** the sysctl() binary interface. However this interface 11 - ** is unstable and deprecated and will be removed in the future. 12 - ** For a stable interface use /proc/sys. 11 + ** the sysctl() binary interface. Do *NOT* change the 12 + ** numbering of any existing values here, and do not change 13 + ** any numbers within any one set of values. If you have to 14 + ** have to redefine an existing interface, use a new number for it. 15 + ** The kernel will then return -ENOTDIR to any application using 16 + ** the old binary interface. 17 + ** 18 + ** For new interfaces unless you really need a binary number 19 + ** please use CTL_UNNUMBERED. 13 20 ** 14 21 **************************************************************** 15 22 **************************************************************** ··· 55 48 #ifdef __KERNEL__ 56 49 #define CTL_ANY -1 /* Matches any name */ 57 50 #define CTL_NONE 0 51 + #define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */ 58 52 #endif 59 53 60 54 enum