Removal of binary sysctl support
Subsystems (47)
cover Removal of binary sysctl support
This patchset reimplements sys_sysctl as a compatibility wrapper around /proc/sys. After which it removes all of the code to all over the kernel that is used today to implement the binary sysctls.
I am posting this patchset to give everyone a heads up what is in flight.
I intend to carry all of these patches in my sysctl tree.
If you add new sysctls to other trees please don't set the .ctl_name or .strategy fields in struct ctl_table, as setting those fields is unnecessary now and are removed by this patchset.
Last I looked at linux-next is only one new sysctl that is not in Linus's tree under net/ipv6. David I will send you a patch in a bit to remove the unnecessary .ctl_name = CTL_UNNUMBERED line so that linux-next continues to compile when my tree makes it there.
For your amusement the diffstat of this whole set of changes:
arch/arm/kernel/isa.c | 11 +- arch/arm/mach-bcmring/arch.c | 6 - arch/frv/kernel/pm.c | 106 +-- arch/frv/kernel/sysctl.c | 3 - arch/ia64/kernel/crash.c | 7 +- arch/ia64/kernel/perfmon.c | 6 - arch/mips/lasat/sysctl.c | 99 +-- arch/powerpc/kernel/idle.c | 2 - arch/s390/kernel/debug.c | 9 +- arch/s390/mm/cmm.c | 5 +- arch/sh/kernel/traps_64.c | 7 +- arch/x86/kernel/vsyscall_64.c | 2 +- arch/x86/vdso/vdso32-setup.c | 1 - crypto/proc.c | 10 +- drivers/cdrom/cdrom.c | 8 +- drivers/char/hpet.c | 9 +- drivers/char/ipmi/ipmi_poweroff.c | 9 +- drivers/char/pty.c | 10 +- drivers/char/random.c | 42 +- drivers/char/rtc.c | 9 +- drivers/macintosh/mac_hid.c | 11 +- drivers/md/md.c | 10 +- drivers/misc/sgi-xp/xpc_main.c | 8 - drivers/net/wireless/arlan-proc.c | 181 ++-- drivers/parport/procfs.c | 11 +- drivers/s390/char/sclp_async.c | 5 +- drivers/scsi/scsi_sysctl.c | 9 +- fs/coda/sysctl.c | 4 - fs/eventpoll.c | 2 +- fs/lockd/svc.c | 14 +- fs/nfs/sysctl.c | 14 +- fs/notify/inotify/inotify_user.c | 8 +- fs/ntfs/sysctl.c | 2 - fs/ocfs2/stackglue.c | 13 +- fs/proc/proc_sysctl.c | 4 +- fs/quota/dquot.c | 17 +- fs/xfs/linux-2.6/xfs_sysctl.c | 32 - include/linux/sysctl.h | 20 +- include/net/dn_dev.h | 1 - include/net/neighbour.h | 3 +- init/Kconfig | 1 + ipc/ipc_sysctl.c | 77 -- ipc/mq_sysctl.c | 7 +- kernel/sched.c | 5 +- kernel/slow-work.c | 5 +- kernel/sysctl.c | 462 +------- kernel/sysctl_binary.c | 1485 ++++++++++++++++++++++-- kernel/sysctl_check.c | 1376 +---------------------- kernel/utsname_sysctl.c | 31 - lib/Kconfig.debug | 2 +- net/802/tr.c | 7 +- net/appletalk/sysctl_net_atalk.c | 13 +- net/ax25/sysctl_net_ax25.c | 38 +- net/bridge/br_netfilter.c | 6 +- net/core/neighbour.c | 47 +- net/core/sysctl_net_core.c | 21 +- net/dccp/sysctl.c | 8 +- net/decnet/dn_dev.c | 64 +- net/decnet/sysctl_net_decnet.c | 124 +-- net/ipv4/arp.c | 2 +- net/ipv4/devinet.c | 111 +-- net/ipv4/ip_fragment.c | 6 - net/ipv4/netfilter.c | 6 +- net/ipv4/netfilter/ip_queue.c | 3 +- net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 10 +- net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 8 +- net/ipv4/route.c | 73 +- net/ipv4/sysctl_net_ipv4.c | 164 +--- net/ipv4/xfrm4_policy.c | 1 - net/ipv6/addrconf.c | 90 +-- net/ipv6/icmp.c | 4 +- net/ipv6/ndisc.c | 39 +- net/ipv6/netfilter/ip6_queue.c | 4 +- net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 4 +- net/ipv6/netfilter/nf_conntrack_reasm.c | 4 +- net/ipv6/reassembly.c | 6 - net/ipv6/route.c | 18 +- net/ipv6/sysctl_net_ipv6.c | 12 +- net/ipv6/xfrm6_policy.c | 1 - net/ipx/sysctl_net_ipx.c | 7 +- net/irda/irsysctl.c | 31 +- net/llc/sysctl_net_llc.c | 25 +- net/netfilter/core.c | 4 +- net/netfilter/ipvs/ip_vs_ctl.c | 6 +- net/netfilter/ipvs/ip_vs_lblc.c | 2 +- net/netfilter/ipvs/ip_vs_lblcr.c | 2 +- net/netfilter/nf_conntrack_acct.c | 1 - net/netfilter/nf_conntrack_ecache.c | 2 - net/netfilter/nf_conntrack_proto_dccp.c | 12 +- net/netfilter/nf_conntrack_proto_generic.c | 8 +- net/netfilter/nf_conntrack_proto_sctp.c | 8 +- net/netfilter/nf_conntrack_proto_tcp.c | 14 +- net/netfilter/nf_conntrack_proto_udp.c | 8 +- net/netfilter/nf_conntrack_proto_udplite.c | 6 +- net/netfilter/nf_conntrack_standalone.c | 14 +- net/netfilter/nf_log.c | 7 +- net/netrom/sysctl_net_netrom.c | 30 +- net/phonet/sysctl.c | 8 +- net/rds/ib_sysctl.c | 14 +- net/rds/iw_sysctl.c | 14 +- net/rds/sysctl.c | 11 +- net/rose/sysctl_net_rose.c | 26 +- net/sctp/sysctl.c | 49 +- net/sunrpc/sysctl.c | 5 +- net/sunrpc/xprtrdma/svc_rdma.c | 16 +- net/sunrpc/xprtrdma/transport.c | 20 +- net/sunrpc/xprtsock.c | 18 +- net/unix/sysctl_net_unix.c | 7 +- net/x25/sysctl_net_x25.c | 15 +- net/xfrm/xfrm_sysctl.c | 4 - security/keys/sysctl.c | 7 +- 111 files changed, 1702 insertions(+), 3774 deletions(-)
Eric
PATCH 1/23 sysctl: Remove the unused frv sysctl unumbers
From: Eric W. Biederman <[email protected]>
The frv sysctl tables can only be used from proc so kill the sysctl numbers.
--- arch/frv/kernel/pm.c | 2 +- arch/frv/kernel/sysctl.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/frv/kernel/pm.c +1 -1
@@ -393,7 +393,7 @@ static int cm_sysctl(ctl_table *table,static struct ctl_table pm_table[] = { { - .ctl_name =CTL_PM_SUSPEND , + .ctl_name =CTL_UNNUMBERED , .procname ="suspend" , .data =NULL , .maxlen =0 ,
arch/frv/kernel/sysctl.c +3 -3
@@ -176,7 +176,7 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,static struct ctl_table frv_table[] = { { - .ctl_name =1 , + .ctl_name =CTL_UNNUMBERD , .procname ="cache-mode" , .data =NULL , .maxlen =0 ,
@@ -185,7 +185,7 @@ static struct ctl_table frv_table[] = },#ifdef CONFIG_MMU { - .ctl_name = 2, + .ctl_name = CTL_UNNUMBERD, .procname = "pin-cxnr", .data = NULL, .maxlen = 0,
@@ -203,7 +203,7 @@ static struct ctl_table frv_table[] =static struct ctl_table frv_dir_table[] = { { - .ctl_name =CTL_FRV , + .ctl_name =CTL_UNNUMBERED , .procname ="frv" , .mode =0555 , .child = frv_table
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 2/23 sysctl: Stop using binary sysctl numbers in arlan.
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Looking at the arlan code it appears all of the sysctl entries are disabled debug code, and have not been enabled since the driver was merged in feb of 2003.
Since except for a select few that userspace can't get along without the binary sysctl table entries are going away. Kill the unused arlan binary sysctls.
--- drivers/net/wireless/arlan-proc.c | 181 ++++++++++++++----------------------- 1 files changed, 69 insertions(+), 112 deletions(-)
drivers/net/wireless/arlan-proc.c +69 -112
@@ -816,84 +816,83 @@ static int arlan_sysctl_reset(ctl_table * ctl, int write,/* Place files in /proc/sys/dev/arlan */ -#define CTBLN (num,card,nam) \ - { .ctl_name = num,\ - .procname = #nam,\ +#define CTBLN (card,nam) \ + { .procname = #nam,\ .data = &(arlan_conf[card].nam),\ .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec}#ifdef ARLAN_DEBUGGING #define ARLAN_PROC_DEBUG_ENTRIES \ - { .ctl_name = 48, .procname = "entry_exit_debug",\ + { .procname = "entry_exit_debug",\ .data = &arlan_entry_and_exit_debug,\ .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},\ - { .ctl_name = 49, .procname = "debug", .data = &arlan_debug,\ + { .procname = "debug", .data = &arlan_debug,\ .maxlen = sizeof(int), .mode = 0600, .proc_handler = &proc_dointvec},#else #define ARLAN_PROC_DEBUG_ENTRIES #endif #define ARLAN_SYSCTL_TABLE_TOTAL (cardNo)\ - CTBLN(1,cardNo,spreadingCode),\ - CTBLN(2,cardNo, channelNumber),\ - CTBLN(3,cardNo, scramblingDisable),\ - CTBLN(4,cardNo, txAttenuation),\ - CTBLN(5,cardNo, systemId), \ - CTBLN(6,cardNo, maxDatagramSize),\ - CTBLN(7,cardNo, maxFrameSize),\ - CTBLN(8,cardNo, maxRetries),\ - CTBLN(9,cardNo, receiveMode),\ - CTBLN(10,cardNo, priority),\ - CTBLN(11,cardNo, rootOrRepeater),\ - CTBLN(12,cardNo, SID),\ - CTBLN(13,cardNo, registrationMode),\ - CTBLN(14,cardNo, registrationFill),\ - CTBLN(15,cardNo, localTalkAddress),\ - CTBLN(16,cardNo, codeFormat),\ - CTBLN(17,cardNo, numChannels),\ - CTBLN(18,cardNo, channel1),\ - CTBLN(19,cardNo, channel2),\ - CTBLN(20,cardNo, channel3),\ - CTBLN(21,cardNo, channel4),\ - CTBLN(22,cardNo, txClear),\ - CTBLN(23,cardNo, txRetries),\ - CTBLN(24,cardNo, txRouting),\ - CTBLN(25,cardNo, txScrambled),\ - CTBLN(26,cardNo, rxParameter),\ - CTBLN(27,cardNo, txTimeoutMs),\ - CTBLN(28,cardNo, waitCardTimeout),\ - CTBLN(29,cardNo, channelSet), \ - {.ctl_name = 30, .procname = "name",\ + CTBLN(cardNo,spreadingCode),\ + CTBLN(cardNo, channelNumber),\ + CTBLN(cardNo, scramblingDisable),\ + CTBLN(cardNo, txAttenuation),\ + CTBLN(cardNo, systemId), \ + CTBLN(cardNo, maxDatagramSize),\ + CTBLN(cardNo, maxFrameSize),\ + CTBLN(cardNo, maxRetries),\ + CTBLN(cardNo, receiveMode),\ + CTBLN(cardNo, priority),\ + CTBLN(cardNo, rootOrRepeater),\ + CTBLN(cardNo, SID),\ + CTBLN(cardNo, registrationMode),\ + CTBLN(cardNo, registrationFill),\ + CTBLN(cardNo, localTalkAddress),\ + CTBLN(cardNo, codeFormat),\ + CTBLN(cardNo, numChannels),\ + CTBLN(cardNo, channel1),\ + CTBLN(cardNo, channel2),\ + CTBLN(cardNo, channel3),\ + CTBLN(cardNo, channel4),\ + CTBLN(cardNo, txClear),\ + CTBLN(cardNo, txRetries),\ + CTBLN(cardNo, txRouting),\ + CTBLN(cardNo, txScrambled),\ + CTBLN(cardNo, rxParameter),\ + CTBLN(cardNo, txTimeoutMs),\ + CTBLN(cardNo, waitCardTimeout),\ + CTBLN(cardNo, channelSet), \ + { .procname = "name",\ .data = arlan_conf[cardNo].siteName,\ .maxlen = 16, .mode = 0600, .proc_handler = &proc_dostring},\ - CTBLN(31,cardNo,waitTime),\ - CTBLN(32,cardNo,lParameter),\ - CTBLN(33,cardNo,_15),\ - CTBLN(34,cardNo,headerSize),\ - CTBLN(36,cardNo,tx_delay_ms),\ - CTBLN(37,cardNo,retries),\ - CTBLN(38,cardNo,ReTransmitPacketMaxSize),\ - CTBLN(39,cardNo,waitReTransmitPacketMaxSize),\ - CTBLN(40,cardNo,fastReTransCount),\ - CTBLN(41,cardNo,driverRetransmissions),\ - CTBLN(42,cardNo,txAckTimeoutMs),\ - CTBLN(43,cardNo,registrationInterrupts),\ - CTBLN(44,cardNo,hardwareType),\ - CTBLN(45,cardNo,radioType),\ - CTBLN(46,cardNo,writeEEPROM),\ - CTBLN(47,cardNo,writeRadioType),\ + CTBLN(cardNo,waitTime),\ + CTBLN(cardNo,lParameter),\ + CTBLN(cardNo,_15),\ + CTBLN(cardNo,headerSize),\ + CTBLN(cardNo,tx_delay_ms),\ + CTBLN(cardNo,retries),\ + CTBLN(cardNo,ReTransmitPacketMaxSize),\ + CTBLN(cardNo,waitReTransmitPacketMaxSize),\ + CTBLN(cardNo,fastReTransCount),\ + CTBLN(cardNo,driverRetransmissions),\ + CTBLN(cardNo,txAckTimeoutMs),\ + CTBLN(cardNo,registrationInterrupts),\ + CTBLN(cardNo,hardwareType),\ + CTBLN(cardNo,radioType),\ + CTBLN(cardNo,writeEEPROM),\ + CTBLN(cardNo,writeRadioType),\ ARLAN_PROC_DEBUG_ENTRIES\ - CTBLN(50,cardNo,in_speed),\ - CTBLN(51,cardNo,out_speed),\ - CTBLN(52,cardNo,in_speed10),\ - CTBLN(53,cardNo,out_speed10),\ - CTBLN(54,cardNo,in_speed_max),\ - CTBLN(55,cardNo,out_speed_max),\ - CTBLN(56,cardNo,measure_rate),\ - CTBLN(57,cardNo,pre_Command_Wait),\ - CTBLN(58,cardNo,rx_tweak1),\ - CTBLN(59,cardNo,rx_tweak2),\ - CTBLN(60,cardNo,tx_queue_len),\ + CTBLN(cardNo,in_speed),\ + CTBLN(cardNo,out_speed),\ + CTBLN(cardNo,in_speed10),\ + CTBLN(cardNo,out_speed10),\ + CTBLN(cardNo,in_speed_max),\ + CTBLN(cardNo,out_speed_max),\ + CTBLN(cardNo,measure_rate),\ + CTBLN(cardNo,pre_Command_Wait),\ + CTBLN(cardNo,rx_tweak1),\ + CTBLN(cardNo,rx_tweak2),\ + CTBLN(cardNo,tx_queue_len),\
@@ -903,7 +902,6 @@ static ctl_table arlan_conf_table0[] =#ifdef ARLAN_PROC_SHM_DUMP { - .ctl_name = 150, .procname = "arlan0-txRing", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -911,7 +909,6 @@ static ctl_table arlan_conf_table0[] = .proc_handler = &arlan_sysctl_infotxRing, }, { - .ctl_name = 151, .procname = "arlan0-rxRing", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -919,7 +916,6 @@ static ctl_table arlan_conf_table0[] = .proc_handler = &arlan_sysctl_inforxRing, }, { - .ctl_name = 152, .procname = "arlan0-18", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -927,7 +923,6 @@ static ctl_table arlan_conf_table0[] = .proc_handler = &arlan_sysctl_info18, }, { - .ctl_name = 153, .procname = "arlan0-ring", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -935,7 +930,6 @@ static ctl_table arlan_conf_table0[] = .proc_handler = &arlan_sysctl_info161719, }, { - .ctl_name = 154, .procname = "arlan0-shm-cpy", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -944,7 +938,6 @@ static ctl_table arlan_conf_table0[] = },#endif { - .ctl_name = 155, .procname = "config0", .data = &conf_reset_result, .maxlen = 100,
@@ -952,14 +945,13 @@ static ctl_table arlan_conf_table0[] = .proc_handler = &arlan_configure }, { - .ctl_name = 156, .procname = "reset0", .data = &conf_reset_result, .maxlen = 100, .mode = 0400, .proc_handler = &arlan_sysctl_reset, }, - { .ctl_name = 0 } + { } }; static ctl_table arlan_conf_table1[] =
@@ -969,7 +961,6 @@ static ctl_table arlan_conf_table1[] =#ifdef ARLAN_PROC_SHM_DUMP { - .ctl_name = 150, .procname = "arlan1-txRing", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -977,7 +968,6 @@ static ctl_table arlan_conf_table1[] = .proc_handler = &arlan_sysctl_infotxRing, }, { - .ctl_name = 151, .procname = "arlan1-rxRing", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -985,7 +975,6 @@ static ctl_table arlan_conf_table1[] = .proc_handler = &arlan_sysctl_inforxRing, }, { - .ctl_name = 152, .procname = "arlan1-18", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -993,7 +982,6 @@ static ctl_table arlan_conf_table1[] = .proc_handler = &arlan_sysctl_info18, }, { - .ctl_name = 153, .procname = "arlan1-ring", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1001,7 +989,6 @@ static ctl_table arlan_conf_table1[] = .proc_handler = &arlan_sysctl_info161719, }, { - .ctl_name = 154, .procname = "arlan1-shm-cpy", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1010,7 +997,6 @@ static ctl_table arlan_conf_table1[] = },#endif { - .ctl_name = 155, .procname = "config1", .data = &conf_reset_result, .maxlen = 100,
@@ -1018,14 +1004,13 @@ static ctl_table arlan_conf_table1[] = .proc_handler = &arlan_configure, }, { - .ctl_name = 156, .procname = "reset1", .data = &conf_reset_result, .maxlen = 100, .mode = 0400, .proc_handler = &arlan_sysctl_reset, }, - { .ctl_name = 0 } + { } }; static ctl_table arlan_conf_table2[] =
@@ -1035,7 +1020,6 @@ static ctl_table arlan_conf_table2[] =#ifdef ARLAN_PROC_SHM_DUMP { - .ctl_name = 150, .procname = "arlan2-txRing", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1043,7 +1027,6 @@ static ctl_table arlan_conf_table2[] = .proc_handler = &arlan_sysctl_infotxRing, }, { - .ctl_name = 151, .procname = "arlan2-rxRing", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1051,7 +1034,6 @@ static ctl_table arlan_conf_table2[] = .proc_handler = &arlan_sysctl_inforxRing, }, { - .ctl_name = 152, .procname = "arlan2-18", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1059,7 +1041,6 @@ static ctl_table arlan_conf_table2[] = .proc_handler = &arlan_sysctl_info18, }, { - .ctl_name = 153, .procname = "arlan2-ring", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1067,7 +1048,6 @@ static ctl_table arlan_conf_table2[] = .proc_handler = &arlan_sysctl_info161719, }, { - .ctl_name = 154, .procname = "arlan2-shm-cpy", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1076,7 +1056,6 @@ static ctl_table arlan_conf_table2[] = },#endif { - .ctl_name = 155, .procname = "config2", .data = &conf_reset_result, .maxlen = 100,
@@ -1084,14 +1063,13 @@ static ctl_table arlan_conf_table2[] = .proc_handler = &arlan_configure, }, { - .ctl_name = 156, .procname = "reset2", .data = &conf_reset_result, .maxlen = 100, .mode = 0400, .proc_handler = &arlan_sysctl_reset, }, - { .ctl_name = 0 } + { } }; static ctl_table arlan_conf_table3[] =
@@ -1101,7 +1079,6 @@ static ctl_table arlan_conf_table3[] =#ifdef ARLAN_PROC_SHM_DUMP { - .ctl_name = 150, .procname = "arlan3-txRing", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1109,7 +1086,6 @@ static ctl_table arlan_conf_table3[] = .proc_handler = &arlan_sysctl_infotxRing, }, { - .ctl_name = 151, .procname = "arlan3-rxRing", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1117,7 +1093,6 @@ static ctl_table arlan_conf_table3[] = .proc_handler = &arlan_sysctl_inforxRing, }, { - .ctl_name = 152, .procname = "arlan3-18", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1125,7 +1100,6 @@ static ctl_table arlan_conf_table3[] = .proc_handler = &arlan_sysctl_info18, }, { - .ctl_name = 153, .procname = "arlan3-ring", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1133,7 +1107,6 @@ static ctl_table arlan_conf_table3[] = .proc_handler = &arlan_sysctl_info161719, }, { - .ctl_name = 154, .procname = "arlan3-shm-cpy", .data = &arlan_drive_info, .maxlen = ARLAN_STR_SIZE,
@@ -1142,7 +1115,6 @@ static ctl_table arlan_conf_table3[] = },#endif { - .ctl_name = 155, .procname = "config3", .data = &conf_reset_result, .maxlen = 100,
@@ -1150,14 +1122,13 @@ static ctl_table arlan_conf_table3[] = .proc_handler = &arlan_configure, }, { - .ctl_name = 156, .procname = "reset3", .data = &conf_reset_result, .maxlen = 100, .mode = 0400, .proc_handler = &arlan_sysctl_reset, }, - { .ctl_name = 0 } + { } };
@@ -1165,41 +1136,37 @@ static ctl_table arlan_conf_table3[] =static ctl_table arlan_table[] = { { - .ctl_name =0 , .procname ="arlan0" , .maxlen =0 , .mode =0600 , .child = arlan_conf_table0, }, { - .ctl_name =0 , .procname ="arlan1" , .maxlen =0 , .mode =0600 , .child = arlan_conf_table1, }, { - .ctl_name =0 , .procname ="arlan2" , .maxlen =0 , .mode =0600 , .child = arlan_conf_table2, }, { - .ctl_name =0 , .procname ="arlan3" , .maxlen =0 , .mode =0600 , .child = arlan_conf_table3, }, - { .ctl_name =0 } + { } };#else -static ctl_table arlan_table[MAX_ARLANS +1 ] = +static ctl_table arlan_table[] = { - { .ctl_name =0 } + { } };#endif
@@ -1209,22 +1176,14 @@ static ctl_table arlan_table[MAX_ARLANS + 1] =static ctl_table arlan_root_table[] = { { - .ctl_name =CTL_ARLAN , .procname ="arlan" , .maxlen =0 , .mode =0555 , .child = arlan_table, }, - { .ctl_name =0 } + { } }; -/* Make sure that /proc/sys/dev is there */ -//static ctl_table arlan_device_root_table[] = -//{ -// {CTL_DEV, "dev", NULL, 0, 0555, arlan_root_table}, -// {0} -//}; -static struct ctl_table_header *arlan_device_sysctl_header;
@@ -1234,8 +1193,6 @@ int __init init_arlan_proc(void)int i =0 ;if (arlan_device_sysctl_header)return 0 ; -for (i =0 ; i <MAX_ARLANS && arlan_device[i]; i++) - arlan_table[i].ctl_name = i +1 ; arlan_device_sysctl_header =register_sysctl_table (arlan_root_table);if (!arlan_device_sysctl_header)return -1 ;
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 4/23 sysctl: Neuter the generic sysctl strategy routines.
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a compatibility layer on top of /proc/sys these routines are never called but are still put in sysctl tables so I have reduced them to stubs until they can be removed entirely.
--- kernel/sysctl.c | 198 ------------------------------------------------------- 1 files changed, 0 insertions(+), 198 deletions(-)
kernel/sysctl.c +0 -198
@@ -2835,201 +2835,6 @@ int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int write,#endif /* CONFIG_PROC_FS */ - -#ifdef CONFIG_SYSCTL_SYSCALL -/* -* General sysctl support routines -*/ - -/* The generic sysctl data routine (used if no strategy routine supplied) */ -int sysctl_data (struct ctl_table *table, -void __user *oldval,size_t __user *oldlenp, -void __user *newval,size_t newlen) -{ -size_t len; - -/* Get out of I don't have a variable */ -if (!table->data || !table->maxlen) -return -ENOTDIR ; - -if (oldval && oldlenp) { -if (get_user (len, oldlenp)) -return -EFAULT ; -if (len) { -if (len > table->maxlen) - len = table->maxlen; -if (copy_to_user (oldval, table->data, len)) -return -EFAULT ; -if (put_user (len, oldlenp)) -return -EFAULT ; - } - } - -if (newval && newlen) { -if (newlen > table->maxlen) - newlen = table->maxlen; - -if (copy_from_user (table->data, newval, newlen)) -return -EFAULT ; - } -return 1 ; -} - -/* The generic string strategy routine: */ -int sysctl_string (struct ctl_table *table, -void __user *oldval,size_t __user *oldlenp, -void __user *newval,size_t newlen) -{ -if (!table->data || !table->maxlen) -return -ENOTDIR ; - -if (oldval && oldlenp) { -size_t bufsize; -if (get_user (bufsize, oldlenp)) -return -EFAULT ; -if (bufsize) { -size_t len =strlen (table->data), copied; - -/* This shouldn't trigger for a well-formed sysctl */ -if (len > table->maxlen) - len = table->maxlen; - -/* Copy up to a max of bufsize-1 bytes of the string */ - copied = (len >= bufsize) ? bufsize -1 : len; - -if (copy_to_user (oldval, table->data, copied) || -put_user (0 , (char __user *)(oldval + copied))) -return -EFAULT ; -if (put_user (len, oldlenp)) -return -EFAULT ; - } - } -if (newval && newlen) { -size_t len = newlen; -if (len > table->maxlen) - len = table->maxlen; -if (copy_from_user (table->data, newval, len)) -return -EFAULT ; -if (len == table->maxlen) - len--; - ((char *) table->data)[len] =0 ; - } -return 1 ; -} - -/* -* This function makes sure that all of the integers in the vector -* are between the minimum and maximum values given in the arrays -* table->extra1 and table->extra2, respectively. -*/ -int sysctl_intvec (struct ctl_table *table, -void __user *oldval,size_t __user *oldlenp, -void __user *newval,size_t newlen) -{ - -if (newval && newlen) { -int __user *vec = (int __user *) newval; -int *min = (int *) table->extra1; -int *max = (int *) table->extra2; -size_t length; -int i; - -if (newlen %sizeof (int ) !=0 ) -return -EINVAL ; - -if (!table->extra1 && !table->extra2) -return 0 ; - -if (newlen > table->maxlen) - newlen = table->maxlen; - length = newlen /sizeof (int ); - -for (i =0 ; i < length; i++) { -int value; -if (get_user (value, vec + i)) -return -EFAULT ; -if (min && value < min[i]) -return -EINVAL ; -if (max && value > max[i]) -return -EINVAL ; - } - } -return 0 ; -} - -/* Strategy function to convert jiffies to seconds */ -int sysctl_jiffies (struct ctl_table *table, -void __user *oldval,size_t __user *oldlenp, -void __user *newval,size_t newlen) -{ -if (oldval && oldlenp) { -size_t olen; - -if (get_user (olen, oldlenp)) -return -EFAULT ; -if (olen) { -int val; - -if (olen <sizeof (int )) -return -EINVAL ; - - val = *(int *)(table->data) /HZ ; -if (put_user (val, (int __user *)oldval)) -return -EFAULT ; -if (put_user (sizeof (int ), oldlenp)) -return -EFAULT ; - } - } -if (newval && newlen) { -int new; -if (newlen !=sizeof (int )) -return -EINVAL ; -if (get_user (new, (int __user *)newval)) -return -EFAULT ; - *(int *)(table->data) = new*HZ ; - } -return 1 ; -} - -/* Strategy function to convert jiffies to seconds */ -int sysctl_ms_jiffies (struct ctl_table *table, -void __user *oldval,size_t __user *oldlenp, -void __user *newval,size_t newlen) -{ -if (oldval && oldlenp) { -size_t olen; - -if (get_user (olen, oldlenp)) -return -EFAULT ; -if (olen) { -int val; - -if (olen <sizeof (int )) -return -EINVAL ; - - val =jiffies_to_msecs (*(int *)(table->data)); -if (put_user (val, (int __user *)oldval)) -return -EFAULT ; -if (put_user (sizeof (int ), oldlenp)) -return -EFAULT ; - } - } -if (newval && newlen) { -int new; -if (newlen !=sizeof (int )) -return -EINVAL ; -if (get_user (new, (int __user *)newval)) -return -EFAULT ; - *(int *)(table->data) =msecs_to_jiffies (new); - } -return 1 ; -} - - - -#else /* CONFIG_SYSCTL_SYSCALL */ - -int sysctl_data (struct ctl_table *table,void __user *oldval,size_t __user *oldlenp,void __user *newval,size_t newlen)
@@ -3065,9 +2870,6 @@ int sysctl_ms_jiffies(struct ctl_table *table,return -ENOSYS ; } -#endif /* CONFIG_SYSCTL_SYSCALL */ - -/* * No sense putting this after each symbol definition, twice, * exception granted :-)
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 9/23 sysctl net: Remove unused binary sysctl code
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a compatiblity wrapper around /proc/sys all sysctl strategy routines, and all ctl_name and strategy entries in the sysctl tables are unused, and can be revmoed.
In addition neigh_sysctl_register has been modified to no longer take a strategy argument and it's callers have been modified not to pass one.
--- include/net/dn_dev.h | 1 - include/net/neighbour.h | 3 +- net/802/tr.c | 7 +- net/appletalk/sysctl_net_atalk.c | 13 +-- net/ax25/sysctl_net_ax25.c | 38 +----- net/bridge/br_netfilter.c | 6 +- net/core/neighbour.c | 47 +------ net/core/sysctl_net_core.c | 21 +--- net/dccp/sysctl.c | 8 +- net/decnet/dn_dev.c | 64 +--------- net/decnet/sysctl_net_decnet.c | 124 +----------------- net/ipv4/arp.c | 2 +- net/ipv4/devinet.c | 111 +++-------------- net/ipv4/ip_fragment.c | 6 - net/ipv4/netfilter.c | 6 +- net/ipv4/netfilter/ip_queue.c | 3 +- net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c | 10 +-- net/ipv4/netfilter/nf_conntrack_proto_icmp.c | 8 +- net/ipv4/route.c | 73 ++--------- net/ipv4/sysctl_net_ipv4.c | 164 +----------------------- net/ipv4/xfrm4_policy.c | 1 - net/ipv6/addrconf.c | 90 ++------------ net/ipv6/icmp.c | 4 +- net/ipv6/ndisc.c | 39 +------ net/ipv6/netfilter/ip6_queue.c | 4 +- net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c | 4 +- net/ipv6/netfilter/nf_conntrack_reasm.c | 4 +- net/ipv6/reassembly.c | 6 - net/ipv6/route.c | 18 +--- net/ipv6/sysctl_net_ipv6.c | 12 +- net/ipv6/xfrm6_policy.c | 1 - net/ipx/sysctl_net_ipx.c | 7 +- net/irda/irsysctl.c | 31 +---- net/llc/sysctl_net_llc.c | 25 +--- net/netfilter/core.c | 4 +- net/netfilter/ipvs/ip_vs_ctl.c | 6 +- net/netfilter/ipvs/ip_vs_lblc.c | 2 +- net/netfilter/ipvs/ip_vs_lblcr.c | 2 +- net/netfilter/nf_conntrack_acct.c | 1 - net/netfilter/nf_conntrack_ecache.c | 2 - net/netfilter/nf_conntrack_proto_dccp.c | 12 +-- net/netfilter/nf_conntrack_proto_generic.c | 8 +- net/netfilter/nf_conntrack_proto_sctp.c | 8 +- net/netfilter/nf_conntrack_proto_tcp.c | 14 +-- net/netfilter/nf_conntrack_proto_udp.c | 8 +- net/netfilter/nf_conntrack_proto_udplite.c | 6 +- net/netfilter/nf_conntrack_standalone.c | 14 +-- net/netfilter/nf_log.c | 7 +- net/netrom/sysctl_net_netrom.c | 30 +---- net/phonet/sysctl.c | 8 +- net/rds/ib_sysctl.c | 14 +-- net/rds/iw_sysctl.c | 14 +-- net/rds/sysctl.c | 11 +- net/rose/sysctl_net_rose.c | 26 +---- net/sctp/sysctl.c | 49 +------- net/sunrpc/sysctl.c | 5 +- net/sunrpc/xprtrdma/svc_rdma.c | 16 +-- net/sunrpc/xprtrdma/transport.c | 20 +--- net/sunrpc/xprtsock.c | 18 +--- net/unix/sysctl_net_unix.c | 7 +- net/x25/sysctl_net_x25.c | 15 +-- net/xfrm/xfrm_sysctl.c | 4 - 62 files changed, 162 insertions(+), 1130 deletions(-)
include/net/dn_dev.h +0 -1
@@ -75,7 +75,6 @@ struct dn_dev_parms {unsigned long t3;/* Default value of t3 */ int priority;/* Priority to be a router */ char *name;/* Name for sysctl */ -int ctl_name;/* Index for sysctl */ int (*up)(struct net_device *);void (*down)(struct net_device *);void (*timer3)(struct net_device *,struct dn_ifaddr *ifa);
include/net/neighbour.h +1 -2
@@ -264,8 +264,7 @@ extern int neigh_sysctl_register(struct net_device *dev,struct neigh_parms *p, int p_id, int pdev_id, char *p_name, - proc_handler *proc_handler, - ctl_handler *strategy); + proc_handler *proc_handler);extern void neigh_sysctl_unregister (struct neigh_parms *p);static inline void __neigh_parms_put (struct neigh_parms *parms)
net/802/tr.c +3 -4
@@ -635,19 +635,18 @@ struct net_device *alloc_trdev(int sizeof_priv)#ifdef CONFIG_SYSCTL static struct ctl_table tr_table[] = { { - .ctl_name =NET_TR_RIF_TIMEOUT , .procname ="rif_timeout" , .data = &sysctl_tr_rif_timeout, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec }, - {0 }, + { }, };static __initdata struct ctl_path tr_path[] = { - { .procname ="net" , .ctl_name =CTL_NET , }, - { .procname ="token-ring" , .ctl_name =NET_TR , }, + { .procname ="net" , }, + { .procname ="token-ring" , }, { } };#endif
net/appletalk/sysctl_net_atalk.c +3 -10
@@ -12,25 +12,20 @@static struct ctl_table atalk_table[] = { { - .ctl_name =NET_ATALK_AARP_EXPIRY_TIME , .procname ="aarp-expiry-time" , .data = &sysctl_aarp_expiry_time, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name =NET_ATALK_AARP_TICK_TIME , .procname ="aarp-tick-time" , .data = &sysctl_aarp_tick_time, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name =NET_ATALK_AARP_RETRANSMIT_LIMIT , .procname ="aarp-retransmit-limit" , .data = &sysctl_aarp_retransmit_limit, .maxlen =sizeof (int ),
@@ -38,20 +33,18 @@ static struct ctl_table atalk_table[] = { .proc_handler = proc_dointvec, }, { - .ctl_name = NET_ATALK_AARP_RESOLVE_TIME, .procname = "aarp-resolve-time", .data = &sysctl_aarp_resolve_time, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, - { 0 }, + { }, };static struct ctl_path atalk_path[] = { - { .procname ="net" , .ctl_name =CTL_NET , }, - { .procname ="appletalk" , .ctl_name =NET_ATALK , }, + { .procname ="net" , }, + { .procname ="appletalk" , }, { } };
net/ax25/sysctl_net_ax25.c +4 -34
@@ -34,156 +34,128 @@ static ctl_table *ax25_table;static int ax25_table_size;static struct ctl_path ax25_path[] = { - { .procname ="net" , .ctl_name =CTL_NET , }, - { .procname ="ax25" , .ctl_name =NET_AX25 , }, + { .procname ="net" , }, + { .procname ="ax25" , }, { } };static const ctl_table ax25_param_table[] = { { - .ctl_name =NET_AX25_IP_DEFAULT_MODE , .procname ="ip_default_mode" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_ipdefmode, .extra2 = &max_ipdefmode }, { - .ctl_name =NET_AX25_DEFAULT_MODE , .procname ="ax25_default_mode" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_axdefmode, .extra2 = &max_axdefmode }, { - .ctl_name =NET_AX25_BACKOFF_TYPE , .procname ="backoff_type" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_backoff, .extra2 = &max_backoff }, { - .ctl_name =NET_AX25_CONNECT_MODE , .procname ="connect_mode" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_conmode, .extra2 = &max_conmode }, { - .ctl_name =NET_AX25_STANDARD_WINDOW , .procname ="standard_window_size" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_window, .extra2 = &max_window }, { - .ctl_name =NET_AX25_EXTENDED_WINDOW , .procname ="extended_window_size" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_ewindow, .extra2 = &max_ewindow }, { - .ctl_name =NET_AX25_T1_TIMEOUT , .procname ="t1_timeout" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_t1, .extra2 = &max_t1 }, { - .ctl_name =NET_AX25_T2_TIMEOUT , .procname ="t2_timeout" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_t2, .extra2 = &max_t2 }, { - .ctl_name =NET_AX25_T3_TIMEOUT , .procname ="t3_timeout" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_t3, .extra2 = &max_t3 }, { - .ctl_name =NET_AX25_IDLE_TIMEOUT , .procname ="idle_timeout" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_idle, .extra2 = &max_idle }, { - .ctl_name =NET_AX25_N2 , .procname ="maximum_retry_count" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_n2, .extra2 = &max_n2 }, { - .ctl_name =NET_AX25_PACLEN , .procname ="maximum_packet_length" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_paclen, .extra2 = &max_paclen }, { - .ctl_name =NET_AX25_PROTOCOL , .procname ="protocol" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_proto, .extra2 = &max_proto }, #ifdef CONFIG_AX25_DAMA_SLAVE { - .ctl_name =NET_AX25_DAMA_SLAVE_TIMEOUT , .procname ="dama_slave_timeout" , .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_ds_timeout, .extra2 = &max_ds_timeout }, #endif - { .ctl_name =0 }/* that's all, folks! */ + { }/* that's all, folks! */ };void ax25_register_sysctl (void )
@@ -212,11 +184,9 @@ void ax25_register_sysctl(void)return ; } ax25_table[n].child = ax25_dev->systable = child; - ax25_table[n].ctl_name = n +1 ; ax25_table[n].procname = ax25_dev->dev->name; ax25_table[n].mode =0555 ; - child[AX25_MAX_VALUES ].ctl_name =0 ;/* just in case... */ for (k =0 ; k <AX25_MAX_VALUES ; k++) child[k].data = &ax25_dev->values[k];
@@ -233,7 +203,7 @@ void ax25_unregister_sysctl(void)ctl_table *p;unregister_sysctl_table (ax25_table_header); -for (p = ax25_table; p->ctl_name; p++) +for (p = ax25_table; p->procname; p++)kfree (p->child);kfree (ax25_table); }
net/bridge/br_netfilter.c +3 -3
@@ -1013,12 +1013,12 @@ static ctl_table brnf_table[] = { .mode = 0644, .proc_handler = brnf_sysctl_call_tables, }, - { .ctl_name = 0 } + { } };static struct ctl_path brnf_path[] = { - { .procname ="net" , .ctl_name =CTL_NET , }, - { .procname ="bridge" , .ctl_name =NET_BRIDGE , }, + { .procname ="net" , }, + { .procname ="bridge" , }, { } };#endif
net/core/neighbour.c +6 -41
174 lines not on this page · raw message
net/core/sysctl_net_core.c +4 -17
@@ -17,7 +17,6 @@ static struct ctl_table net_core_table[] = { #ifdef CONFIG_NET { - .ctl_name = NET_CORE_WMEM_MAX, .procname = "wmem_max", .data = &sysctl_wmem_max, .maxlen = sizeof(int),
@@ -25,7 +24,6 @@ static struct ctl_table net_core_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_CORE_RMEM_MAX, .procname = "rmem_max", .data = &sysctl_rmem_max, .maxlen = sizeof(int),
@@ -33,7 +31,6 @@ static struct ctl_table net_core_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_CORE_WMEM_DEFAULT, .procname = "wmem_default", .data = &sysctl_wmem_default, .maxlen = sizeof(int),
@@ -41,7 +38,6 @@ static struct ctl_table net_core_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_CORE_RMEM_DEFAULT, .procname = "rmem_default", .data = &sysctl_rmem_default, .maxlen = sizeof(int),
@@ -49,7 +45,6 @@ static struct ctl_table net_core_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_CORE_DEV_WEIGHT, .procname = "dev_weight", .data = &weight_p, .maxlen = sizeof(int),
@@ -57,7 +52,6 @@ static struct ctl_table net_core_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_CORE_MAX_BACKLOG, .procname = "netdev_max_backlog", .data = &netdev_max_backlog, .maxlen = sizeof(int),
@@ -65,16 +59,13 @@ static struct ctl_table net_core_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_CORE_MSG_COST, .procname = "message_cost", .data = &net_ratelimit_state.interval, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name = NET_CORE_MSG_BURST, .procname = "message_burst", .data = &net_ratelimit_state.burst, .maxlen = sizeof(int),
@@ -82,7 +73,6 @@ static struct ctl_table net_core_table[] = { .proc_handler = proc_dointvec, }, { - .ctl_name = NET_CORE_OPTMEM_MAX, .procname = "optmem_max", .data = &sysctl_optmem_max, .maxlen = sizeof(int),
@@ -91,7 +81,6 @@ static struct ctl_table net_core_table[] = { },#endif /* CONFIG_NET */ { - .ctl_name = NET_CORE_BUDGET, .procname = "netdev_budget", .data = &netdev_budget, .maxlen = sizeof(int),
@@ -99,31 +88,29 @@ static struct ctl_table net_core_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_CORE_WARNINGS, .procname = "warnings", .data = &net_msg_warn, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec }, - { .ctl_name = 0 } + { } };static struct ctl_table netns_core_table[] = { { - .ctl_name =NET_CORE_SOMAXCONN , .procname ="somaxconn" , .data = &init_net.core.sysctl_somaxconn, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec }, - { .ctl_name =0 } + { } };__net_initdata struct ctl_path net_core_path[] = { - { .procname ="net" , .ctl_name =CTL_NET , }, - { .procname ="core" , .ctl_name =NET_CORE , }, + { .procname ="net" , }, + { .procname ="core" , }, { }, };
net/dccp/sysctl.c +4 -4
@@ -93,13 +93,13 @@ static struct ctl_table dccp_default_table[] = { .proc_handler = proc_dointvec_ms_jiffies, }, - { .ctl_name = 0, } + { } };static struct ctl_path dccp_path[] = { - { .procname ="net" , .ctl_name =CTL_NET , }, - { .procname ="dccp" , .ctl_name =NET_DCCP , }, - { .procname ="default" , .ctl_name =NET_DCCP_DEFAULT , }, + { .procname ="net" , }, + { .procname ="dccp" , }, + { .procname ="default" , }, { } };
net/decnet/dn_dev.c +3 -61
162 lines not on this page · raw message
net/decnet/sysctl_net_decnet.c +3 -121
245 lines not on this page · raw message
net/ipv4/arp.c +1 -1
@@ -1240,7 +1240,7 @@ void __init arp_init(void)arp_proc_init ();#ifdef CONFIG_SYSCTL neigh_sysctl_register (NULL , &arp_tbl.parms,NET_IPV4 , -NET_IPV4_NEIGH ,"ipv4" ,NULL ,NULL ); +NET_IPV4_NEIGH ,"ipv4" ,NULL );#endif register_netdevice_notifier (&arp_netdev_notifier); }
net/ipv4/devinet.c +17 -94
197 lines not on this page · raw message
net/ipv4/ip_fragment.c +0 -6
@@ -603,7 +603,6 @@ static int zero;static struct ctl_table ip4_frags_ns_ctl_table[] = { { - .ctl_name =NET_IPV4_IPFRAG_HIGH_THRESH , .procname ="ipfrag_high_thresh" , .data = &init_net.ipv4.frags.high_thresh, .maxlen =sizeof (int ),
@@ -611,7 +610,6 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_IPV4_IPFRAG_LOW_THRESH, .procname = "ipfrag_low_thresh", .data = &init_net.ipv4.frags.low_thresh, .maxlen = sizeof(int),
@@ -619,26 +617,22 @@ static struct ctl_table ip4_frags_ns_ctl_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_IPV4_IPFRAG_TIME, .procname = "ipfrag_time", .data = &init_net.ipv4.frags.timeout, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies }, { } };static struct ctl_table ip4_frags_ctl_table[] = { { - .ctl_name =NET_IPV4_IPFRAG_SECRET_INTERVAL , .procname ="ipfrag_secret_interval" , .data = &ip4_frags.secret_interval, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies }, { .procname ="ipfrag_max_dist" ,
net/ipv4/netfilter.c +3 -3
@@ -248,9 +248,9 @@ module_exit(ipv4_netfilter_fini);#ifdef CONFIG_SYSCTL struct ctl_path nf_net_ipv4_netfilter_sysctl_path[] = { - { .procname ="net" , .ctl_name =CTL_NET , }, - { .procname ="ipv4" , .ctl_name =NET_IPV4 , }, - { .procname ="netfilter" , .ctl_name =NET_IPV4_NETFILTER , }, + { .procname ="net" , }, + { .procname ="ipv4" , }, + { .procname ="netfilter" , }, { } };EXPORT_SYMBOL_GPL (nf_net_ipv4_netfilter_sysctl_path);
net/ipv4/netfilter/ip_queue.c +1 -2
@@ -516,14 +516,13 @@ static struct ctl_table_header *ipq_sysctl_header;static ctl_table ipq_table[] = { { - .ctl_name =NET_IPQ_QMAX , .procname =NET_IPQ_QMAX_NAME , .data = &queue_maxlen, .maxlen =sizeof (queue_maxlen), .mode =0644 , .proc_handler = proc_dointvec }, - { .ctl_name =0 } + { } };#endif
net/ipv4/netfilter/nf_conntrack_l3proto_ipv4.c +1 -9
@@ -195,7 +195,6 @@ static int log_invalid_proto_max = 255;static ctl_table ip_ct_sysctl_table[] = { { - .ctl_name =NET_IPV4_NF_CONNTRACK_MAX , .procname ="ip_conntrack_max" , .data = &nf_conntrack_max, .maxlen =sizeof (int ),
@@ -203,7 +202,6 @@ static ctl_table ip_ct_sysctl_table[] = { .proc_handler = proc_dointvec, }, { - .ctl_name = NET_IPV4_NF_CONNTRACK_COUNT, .procname = "ip_conntrack_count", .data = &init_net.ct.count, .maxlen = sizeof(int),
@@ -211,7 +209,6 @@ static ctl_table ip_ct_sysctl_table[] = { .proc_handler = proc_dointvec, }, { - .ctl_name = NET_IPV4_NF_CONNTRACK_BUCKETS, .procname = "ip_conntrack_buckets", .data = &nf_conntrack_htable_size, .maxlen = sizeof(unsigned int),
@@ -219,7 +216,6 @@ static ctl_table ip_ct_sysctl_table[] = { .proc_handler = proc_dointvec, }, { - .ctl_name = NET_IPV4_NF_CONNTRACK_CHECKSUM, .procname = "ip_conntrack_checksum", .data = &init_net.ct.sysctl_checksum, .maxlen = sizeof(int),
@@ -227,19 +223,15 @@ static ctl_table ip_ct_sysctl_table[] = { .proc_handler = proc_dointvec, }, { - .ctl_name = NET_IPV4_NF_CONNTRACK_LOG_INVALID, .procname = "ip_conntrack_log_invalid", .data = &init_net.ct.sysctl_log_invalid, .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &log_invalid_proto_min, .extra2 = &log_invalid_proto_max, }, - { - .ctl_name = 0 - } + { } };#endif /* CONFIG_SYSCTL && CONFIG_NF_CONNTRACK_PROC_COMPAT */
net/ipv4/netfilter/nf_conntrack_proto_icmp.c +2 -6
@@ -270,9 +270,7 @@ static struct ctl_table icmp_sysctl_table[] = { .mode = 0644, .proc_handler = proc_dointvec_jiffies, }, - { - .ctl_name = 0 - } + { } };#ifdef CONFIG_NF_CONNTRACK_PROC_COMPAT static struct ctl_table icmp_compat_sysctl_table[] = {
@@ -283,9 +281,7 @@ static struct ctl_table icmp_compat_sysctl_table[] = { .mode = 0644, .proc_handler = proc_dointvec_jiffies, }, - { - .ctl_name = 0 - } + { } };#endif /* CONFIG_NF_CONNTRACK_PROC_COMPAT */ #endif /* CONFIG_SYSCTL */
net/ipv4/route.c +9 -64
213 lines not on this page · raw message
net/ipv4/sysctl_net_ipv4.c +3 -161
640 lines not on this page · raw message
net/ipv4/xfrm4_policy.c +0 -1
@@ -267,7 +267,6 @@ static struct xfrm_policy_afinfo xfrm4_policy_afinfo = { #ifdef CONFIG_SYSCTL static struct ctl_table xfrm4_policy_table[] = { { - .ctl_name = CTL_UNNUMBERED, .procname = "xfrm4_gc_thresh", .data = &xfrm4_dst_ops.gc_thresh, .maxlen = sizeof(int),
net/ipv6/addrconf.c +9 -81
309 lines not on this page · raw message
net/ipv6/icmp.c +1 -3
@@ -942,15 +942,13 @@ EXPORT_SYMBOL(icmpv6_err_convert); #ifdef CONFIG_SYSCTL ctl_table ipv6_icmp_table_template[] = { { - .ctl_name = NET_IPV6_ICMP_RATELIMIT, .procname = "ratelimit", .data = &init_net.ipv6.sysctl.icmpv6_time, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_ms_jiffies, - .strategy = sysctl_ms_jiffies }, - { .ctl_name = 0 }, + { }, }; struct ctl_table *ipv6_icmp_sysctl_init(struct net *net)
net/ipv6/ndisc.c +1 -38
@@ -1768,42 +1768,6 @@ int ndisc_ifinfo_sysctl_change(struct ctl_table *ctl, int write, void __user *bu return ret; } -int ndisc_ifinfo_sysctl_strategy(ctl_table *ctl, - void __user *oldval, size_t __user *oldlenp, - void __user *newval, size_t newlen) -{ - struct net_device *dev = ctl->extra1; - struct inet6_dev *idev; - int ret; - - if (ctl->ctl_name == NET_NEIGH_RETRANS_TIME || - ctl->ctl_name == NET_NEIGH_REACHABLE_TIME) - ndisc_warn_deprecated_sysctl(ctl, "procfs", dev ? dev->name : "default"); - - switch (ctl->ctl_name) { - case NET_NEIGH_REACHABLE_TIME: - ret = sysctl_jiffies(ctl, oldval, oldlenp, newval, newlen); - break; - case NET_NEIGH_RETRANS_TIME_MS: - case NET_NEIGH_REACHABLE_TIME_MS: - ret = sysctl_ms_jiffies(ctl, oldval, oldlenp, newval, newlen); - break; - default: - ret = 0; - } - - if (newval && newlen && ret > 0 && - dev && (idev = in6_dev_get(dev)) != NULL) { - if (ctl->ctl_name == NET_NEIGH_REACHABLE_TIME || - ctl->ctl_name == NET_NEIGH_REACHABLE_TIME_MS) - idev->nd_parms->reachable_time = neigh_rand_reach_time(idev->nd_parms->base_reachable_time); - idev->tstamp = jiffies; - inet6_ifinfo_notify(RTM_NEWLINK, idev); - in6_dev_put(idev); - } - - return ret; -} #endif
@@ -1857,8 +1821,7 @@ int __init ndisc_init(void) #ifdef CONFIG_SYSCTL err = neigh_sysctl_register(NULL, &nd_tbl.parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6", - &ndisc_ifinfo_sysctl_change, - &ndisc_ifinfo_sysctl_strategy); + &ndisc_ifinfo_sysctl_change); if (err) goto out_unregister_pernet; #endif
net/ipv6/netfilter/ip6_queue.c +1 -3
@@ -36,7 +36,6 @@ #define IPQ_QMAX_DEFAULT 1024 #define IPQ_PROC_FS_NAME "ip6_queue" -#define NET_IPQ_QMAX 2088 #define NET_IPQ_QMAX_NAME "ip6_queue_maxlen" typedef int (*ipq_cmpfn)(struct nf_queue_entry *, unsigned long);
@@ -518,14 +517,13 @@ static struct ctl_table_header *ipq_sysctl_header; static ctl_table ipq_table[] = { { - .ctl_name = NET_IPQ_QMAX, .procname = NET_IPQ_QMAX_NAME, .data = &queue_maxlen, .maxlen = sizeof(queue_maxlen), .mode = 0644, .proc_handler = proc_dointvec }, - { .ctl_name = 0 } + { } }; #endif
net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c +1 -3
@@ -277,9 +277,7 @@ static struct ctl_table icmpv6_sysctl_table[] = { .mode = 0644, .proc_handler = proc_dointvec_jiffies, }, - { - .ctl_name = 0 - } + { } }; #endif /* CONFIG_SYSCTL */
net/ipv6/netfilter/nf_conntrack_reasm.c +1 -3
@@ -83,7 +83,6 @@ struct ctl_table nf_ct_ipv6_sysctl_table[] = { .proc_handler = proc_dointvec_jiffies, }, { - .ctl_name = NET_NF_CONNTRACK_FRAG6_LOW_THRESH, .procname = "nf_conntrack_frag6_low_thresh", .data = &nf_init_frags.low_thresh, .maxlen = sizeof(unsigned int),
@@ -91,14 +90,13 @@ struct ctl_table nf_ct_ipv6_sysctl_table[] = { .proc_handler = proc_dointvec, }, { - .ctl_name = NET_NF_CONNTRACK_FRAG6_HIGH_THRESH, .procname = "nf_conntrack_frag6_high_thresh", .data = &nf_init_frags.high_thresh, .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = proc_dointvec, }, - { .ctl_name = 0 } + { } }; #endif
net/ipv6/reassembly.c +0 -6
@@ -636,7 +636,6 @@ static const struct inet6_protocol frag_protocol = #ifdef CONFIG_SYSCTL static struct ctl_table ip6_frags_ns_ctl_table[] = { { - .ctl_name = NET_IPV6_IP6FRAG_HIGH_THRESH, .procname = "ip6frag_high_thresh", .data = &init_net.ipv6.frags.high_thresh, .maxlen = sizeof(int),
@@ -644,7 +643,6 @@ static struct ctl_table ip6_frags_ns_ctl_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_IPV6_IP6FRAG_LOW_THRESH, .procname = "ip6frag_low_thresh", .data = &init_net.ipv6.frags.low_thresh, .maxlen = sizeof(int),
@@ -652,26 +650,22 @@ static struct ctl_table ip6_frags_ns_ctl_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_IPV6_IP6FRAG_TIME, .procname = "ip6frag_time", .data = &init_net.ipv6.frags.timeout, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { } }; static struct ctl_table ip6_frags_ctl_table[] = { { - .ctl_name = NET_IPV6_IP6FRAG_SECRET_INTERVAL, .procname = "ip6frag_secret_interval", .data = &ip6_frags.secret_interval, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies }, { } };
net/ipv6/route.c +1 -17
@@ -2546,7 +2546,6 @@ ctl_table ipv6_route_table_template[] = { .proc_handler = ipv6_sysctl_rtcache_flush }, { - .ctl_name = NET_IPV6_ROUTE_GC_THRESH, .procname = "gc_thresh", .data = &ip6_dst_ops_template.gc_thresh, .maxlen = sizeof(int),
@@ -2554,7 +2553,6 @@ ctl_table ipv6_route_table_template[] = { .proc_handler = proc_dointvec, }, { - .ctl_name = NET_IPV6_ROUTE_MAX_SIZE, .procname = "max_size", .data = &init_net.ipv6.sysctl.ip6_rt_max_size, .maxlen = sizeof(int),
@@ -2562,69 +2560,55 @@ ctl_table ipv6_route_table_template[] = { .proc_handler = proc_dointvec, }, { - .ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL, .procname = "gc_min_interval", .data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name = NET_IPV6_ROUTE_GC_TIMEOUT, .procname = "gc_timeout", .data = &init_net.ipv6.sysctl.ip6_rt_gc_timeout, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name = NET_IPV6_ROUTE_GC_INTERVAL, .procname = "gc_interval", .data = &init_net.ipv6.sysctl.ip6_rt_gc_interval, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name = NET_IPV6_ROUTE_GC_ELASTICITY, .procname = "gc_elasticity", .data = &init_net.ipv6.sysctl.ip6_rt_gc_elasticity, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name = NET_IPV6_ROUTE_MTU_EXPIRES, .procname = "mtu_expires", .data = &init_net.ipv6.sysctl.ip6_rt_mtu_expires, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name = NET_IPV6_ROUTE_MIN_ADVMSS, .procname = "min_adv_mss", .data = &init_net.ipv6.sysctl.ip6_rt_min_advmss, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name = NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS, .procname = "gc_min_interval_ms", .data = &init_net.ipv6.sysctl.ip6_rt_gc_min_interval, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_ms_jiffies, - .strategy = sysctl_ms_jiffies, }, - { .ctl_name = 0 } + { } }; struct ctl_table *ipv6_route_sysctl_init(struct net *net)
net/ipv6/sysctl_net_ipv6.c +4 -8
@@ -16,45 +16,41 @@ static ctl_table ipv6_table_template[] = { { - .ctl_name = NET_IPV6_ROUTE, .procname = "route", .maxlen = 0, .mode = 0555, .child = ipv6_route_table_template }, { - .ctl_name = NET_IPV6_ICMP, .procname = "icmp", .maxlen = 0, .mode = 0555, .child = ipv6_icmp_table_template }, { - .ctl_name = NET_IPV6_BINDV6ONLY, .procname = "bindv6only", .data = &init_net.ipv6.sysctl.bindv6only, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec }, - { .ctl_name = 0 } + { } }; static ctl_table ipv6_rotable[] = { { - .ctl_name = NET_IPV6_MLD_MAX_MSF, .procname = "mld_max_msf", .data = &sysctl_mld_max_msf, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec }, - { .ctl_name = 0 } + { } }; struct ctl_path net_ipv6_ctl_path[] = { - { .procname = "net", .ctl_name = CTL_NET, }, - { .procname = "ipv6", .ctl_name = NET_IPV6, }, + { .procname = "net", }, + { .procname = "ipv6", }, { }, }; EXPORT_SYMBOL_GPL(net_ipv6_ctl_path);
net/ipv6/xfrm6_policy.c +0 -1
@@ -309,7 +309,6 @@ static void xfrm6_policy_fini(void) #ifdef CONFIG_SYSCTL static struct ctl_table xfrm6_policy_table[] = { { - .ctl_name = CTL_UNNUMBERED, .procname = "xfrm6_gc_thresh", .data = &xfrm6_dst_ops.gc_thresh, .maxlen = sizeof(int),
net/ipx/sysctl_net_ipx.c +3 -4
@@ -18,19 +18,18 @@ extern int sysctl_ipx_pprop_broadcasting; static struct ctl_table ipx_table[] = { { - .ctl_name = NET_IPX_PPROP_BROADCASTING, .procname = "ipx_pprop_broadcasting", .data = &sysctl_ipx_pprop_broadcasting, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec, }, - { 0 }, + { }, }; static struct ctl_path ipx_path[] = { - { .procname = "net", .ctl_name = CTL_NET, }, - { .procname = "ipx", .ctl_name = NET_IPX, }, + { .procname = "net", }, + { .procname = "ipx", }, { } };
net/irda/irsysctl.c +3 -28
@@ -113,26 +113,21 @@ static int do_discovery(ctl_table *table, int write, /* One file */ static ctl_table irda_table[] = { { - .ctl_name = NET_IRDA_DISCOVERY, .procname = "discovery", .data = &sysctl_discovery, .maxlen = sizeof(int), .mode = 0644, .proc_handler = do_discovery, - .strategy = sysctl_intvec }, { - .ctl_name = NET_IRDA_DEVNAME, .procname = "devname", .data = sysctl_devname, .maxlen = 65, .mode = 0644, .proc_handler = do_devname, - .strategy = sysctl_string }, #ifdef CONFIG_IRDA_DEBUG { - .ctl_name = NET_IRDA_DEBUG, .procname = "debug", .data = &irda_debug, .maxlen = sizeof(int),
@@ -142,7 +137,6 @@ static ctl_table irda_table[] = { #endif #ifdef CONFIG_IRDA_FAST_RR { - .ctl_name = NET_IRDA_FAST_POLL, .procname = "fast_poll_increase", .data = &sysctl_fast_poll_increase, .maxlen = sizeof(int),
@@ -151,18 +145,15 @@ static ctl_table irda_table[] = { }, #endif { - .ctl_name = NET_IRDA_DISCOVERY_SLOTS, .procname = "discovery_slots", .data = &sysctl_discovery_slots, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_discovery_slots, .extra2 = &max_discovery_slots }, { - .ctl_name = NET_IRDA_DISCOVERY_TIMEOUT, .procname = "discovery_timeout", .data = &sysctl_discovery_timeout, .maxlen = sizeof(int),
@@ -170,99 +161,83 @@ static ctl_table irda_table[] = { .proc_handler = proc_dointvec }, { - .ctl_name = NET_IRDA_SLOT_TIMEOUT, .procname = "slot_timeout", .data = &sysctl_slot_timeout, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_slot_timeout, .extra2 = &max_slot_timeout }, { - .ctl_name = NET_IRDA_MAX_BAUD_RATE, .procname = "max_baud_rate", .data = &sysctl_max_baud_rate, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_max_baud_rate, .extra2 = &max_max_baud_rate }, { - .ctl_name = NET_IRDA_MIN_TX_TURN_TIME, .procname = "min_tx_turn_time", .data = &sysctl_min_tx_turn_time, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_min_tx_turn_time, .extra2 = &max_min_tx_turn_time }, { - .ctl_name = NET_IRDA_MAX_TX_DATA_SIZE, .procname = "max_tx_data_size", .data = &sysctl_max_tx_data_size, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_max_tx_data_size, .extra2 = &max_max_tx_data_size }, { - .ctl_name = NET_IRDA_MAX_TX_WINDOW, .procname = "max_tx_window", .data = &sysctl_max_tx_window, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_max_tx_window, .extra2 = &max_max_tx_window }, { - .ctl_name = NET_IRDA_MAX_NOREPLY_TIME, .procname = "max_noreply_time", .data = &sysctl_max_noreply_time, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_max_noreply_time, .extra2 = &max_max_noreply_time }, { - .ctl_name = NET_IRDA_WARN_NOREPLY_TIME, .procname = "warn_noreply_time", .data = &sysctl_warn_noreply_time, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_warn_noreply_time, .extra2 = &max_warn_noreply_time }, { - .ctl_name = NET_IRDA_LAP_KEEPALIVE_TIME, .procname = "lap_keepalive_time", .data = &sysctl_lap_keepalive_time, .maxlen = sizeof(int), .mode = 0644, .proc_handler = proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &min_lap_keepalive_time, .extra2 = &max_lap_keepalive_time }, - { .ctl_name = 0 } + { } }; static struct ctl_path irda_path[] = { - { .procname = "net", .ctl_name = CTL_NET, }, - { .procname = "irda", .ctl_name = NET_IRDA, }, + { .procname = "net", }, + { .procname = "irda", }, { } };
net/llc/sysctl_net_llc.c +6 -19
@@ -15,86 +15,73 @@ static struct ctl_table llc2_timeout_table[] = { { - .ctl_name = NET_LLC2_ACK_TIMEOUT, .procname = "ack", .data = &sysctl_llc2_ack_timeout, .maxlen = sizeof(long), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name = NET_LLC2_BUSY_TIMEOUT, .procname = "busy", .data = &sysctl_llc2_busy_timeout, .maxlen = sizeof(long), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name = NET_LLC2_P_TIMEOUT, .procname = "p", .data = &sysctl_llc2_p_timeout, .maxlen = sizeof(long), .mode = 0644, .proc_handler = proc_dointvec_jiffies, - .strategy = sysctl_jiffies, }, { - .ctl_name = NET_LLC2_REJ_TIMEOUT,
Lines of this file are not shown. View the raw message.
net/netfilter/nf_conntrack_proto_dccp.c +1 -11
Lines of this file are not shown. View the raw message.
net/netfilter/nf_conntrack_proto_generic.c +2 -6
Lines of this file are not shown. View the raw message.
net/netfilter/nf_conntrack_proto_sctp.c +2 -6
Lines of this file are not shown. View the raw message.
net/netfilter/nf_conntrack_proto_tcp.c +2 -12
Lines of this file are not shown. View the raw message.
net/netfilter/nf_conntrack_proto_udplite.c +1 -5
Lines of this file are not shown. View the raw message.
net/netfilter/nf_conntrack_standalone.c +3 -11
Lines of this file are not shown. View the raw message.
net/sctp/sysctl.c +3 -46
49 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
1.6.5.2.143.g8cc62
Part of the diff is not shown here. View the raw message.
PATCH 3/23 sysctl: Reduce sys_sysctl to a compatibility wrapper around /proc/sys
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
To simply maintenance and to be able to remove all of the binary sysctl support from various subsystems I have rewritten the binary sysctl code as a compatibility wrapper around proc/sys.
The code is built around a hard coded table based on the table in sysctl_check.c that lists all of our current binary sysctls and provides enough information to convert from the sysctl binary input into into ascii and back again. New in this patch is the realization that the only dynamic entries that need to be handled have ifname as the asscii string and ifindex as their ctl_name.
When a sys_sysctl is called the code now looks in the translation table converting the binary name to the path under /proc where the value is to be found. Opens that file, and calls into a format conversion wrapper that calls fop->read and then fop->write as appropriate.
Since in practice the practically no one uses or tests sys_sysctl rewritting the code to be beautiful is a little silly. The redeeming merit of this work is it allows us to rip out all of the binary sysctl syscall support from everywhere else in the tree. Allowing us to remove a lot of dead (after this patch) and barely maintained code.
In addition it becomes much easier to optimize the sysctl implementation for being the backing store of /proc/sys, without having to worry about sys_sysctl.
--- init/Kconfig | 1 + kernel/sysctl_binary.c | 1485 ++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 1384 insertions(+), 102 deletions(-)
init/Kconfig +1 -0
@@ -754,6 +754,7 @@ config UID16 config SYSCTL_SYSCALL bool "Sysctl syscall support" if EMBEDDED + depends on PROC_SYSCTL default y select SYSCTL ---help---
kernel/sysctl_binary.c +1383 -102
1,572 lines not on this page · raw message
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 5/23 sysctl: Remove dead code from sysctl_check
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that the sys_sysctl is now a compatibility wrapper around /proc/sys we can remove much of sysctl_check and reduce it to a few remaining sanity checks. This completely decouples it from the binary sysctl system call.
Little things like ensuring that the sysctl has not already been registered are all that remain.
--- kernel/sysctl_check.c | 1376 +------------------------------------------------ lib/Kconfig.debug | 2 +- 2 files changed, 4 insertions(+), 1374 deletions(-)
kernel/sysctl_check.c +3 -1373
@@ -5,1239 +5,6 @@#include <linux/string.h> #include <net/ip_vs.h> -struct trans_ctl_table { -int ctl_name; -const char *procname; -const struct trans_ctl_table *child; -}; - -static const struct trans_ctl_table trans_random_table[] = { - {RANDOM_POOLSIZE ,"poolsize" }, - {RANDOM_ENTROPY_COUNT ,"entropy_avail" }, - {RANDOM_READ_THRESH ,"read_wakeup_threshold" }, - {RANDOM_WRITE_THRESH ,"write_wakeup_threshold" }, - {RANDOM_BOOT_ID ,"boot_id" }, - {RANDOM_UUID ,"uuid" }, - {} -}; - -static const struct trans_ctl_table trans_pty_table[] = { - {PTY_MAX ,"max" }, - {PTY_NR ,"nr" }, - {} -}; - -static const struct trans_ctl_table trans_kern_table[] = { - {KERN_OSTYPE ,"ostype" }, - {KERN_OSRELEASE ,"osrelease" }, -/* KERN_OSREV not used */ - {KERN_VERSION ,"version" }, -/* KERN_SECUREMASK not used */ -/* KERN_PROF not used */ - {KERN_NODENAME ,"hostname" }, - {KERN_DOMAINNAME ,"domainname" }, - - {KERN_PANIC ,"panic" }, - {KERN_REALROOTDEV ,"real-root-dev" }, - - {KERN_SPARC_REBOOT ,"reboot-cmd" }, - {KERN_CTLALTDEL ,"ctrl-alt-del" }, - {KERN_PRINTK ,"printk" }, - -/* KERN_NAMETRANS not used */ -/* KERN_PPC_HTABRECLAIM not used */ -/* KERN_PPC_ZEROPAGED not used */ - {KERN_PPC_POWERSAVE_NAP ,"powersave-nap" }, - - {KERN_MODPROBE ,"modprobe" }, - {KERN_SG_BIG_BUFF ,"sg-big-buff" }, - {KERN_ACCT ,"acct" }, - {KERN_PPC_L2CR ,"l2cr" }, - -/* KERN_RTSIGNR not used */ -/* KERN_RTSIGMAX not used */ - - {KERN_SHMMAX ,"shmmax" }, - {KERN_MSGMAX ,"msgmax" }, - {KERN_MSGMNB ,"msgmnb" }, -/* KERN_MSGPOOL not used*/ - {KERN_SYSRQ ,"sysrq" }, - {KERN_MAX_THREADS ,"threads-max" }, - {KERN_RANDOM ,"random" , trans_random_table }, - {KERN_SHMALL ,"shmall" }, - {KERN_MSGMNI ,"msgmni" }, - {KERN_SEM ,"sem" }, - {KERN_SPARC_STOP_A ,"stop-a" }, - {KERN_SHMMNI ,"shmmni" }, - - {KERN_OVERFLOWUID ,"overflowuid" }, - {KERN_OVERFLOWGID ,"overflowgid" }, - - {KERN_HOTPLUG ,"hotplug" , }, - {KERN_IEEE_EMULATION_WARNINGS ,"ieee_emulation_warnings" }, - - {KERN_S390_USER_DEBUG_LOGGING ,"userprocess_debug" }, - {KERN_CORE_USES_PID ,"core_uses_pid" }, - {KERN_TAINTED ,"tainted" }, - {KERN_CADPID ,"cad_pid" }, - {KERN_PIDMAX ,"pid_max" }, - {KERN_CORE_PATTERN ,"core_pattern" }, - {KERN_PANIC_ON_OOPS ,"panic_on_oops" }, - {KERN_HPPA_PWRSW ,"soft-power" }, - {KERN_HPPA_UNALIGNED ,"unaligned-trap" }, - - {KERN_PRINTK_RATELIMIT ,"printk_ratelimit" }, - {KERN_PRINTK_RATELIMIT_BURST ,"printk_ratelimit_burst" }, - - {KERN_PTY ,"pty" , trans_pty_table }, - {KERN_NGROUPS_MAX ,"ngroups_max" }, - {KERN_SPARC_SCONS_PWROFF ,"scons-poweroff" }, - {KERN_HZ_TIMER ,"hz_timer" }, - {KERN_UNKNOWN_NMI_PANIC ,"unknown_nmi_panic" }, - {KERN_BOOTLOADER_TYPE ,"bootloader_type" }, - {KERN_RANDOMIZE ,"randomize_va_space" }, - - {KERN_SPIN_RETRY ,"spin_retry" }, - {KERN_ACPI_VIDEO_FLAGS ,"acpi_video_flags" }, - {KERN_IA64_UNALIGNED ,"ignore-unaligned-usertrap" }, - {KERN_COMPAT_LOG ,"compat-log" }, - {KERN_MAX_LOCK_DEPTH ,"max_lock_depth" }, - {KERN_NMI_WATCHDOG ,"nmi_watchdog" }, - {KERN_PANIC_ON_NMI ,"panic_on_unrecovered_nmi" }, - {} -}; - -static const struct trans_ctl_table trans_vm_table[] = { - {VM_OVERCOMMIT_MEMORY ,"overcommit_memory" }, - {VM_PAGE_CLUSTER ,"page-cluster" }, - {VM_DIRTY_BACKGROUND ,"dirty_background_ratio" }, - {VM_DIRTY_RATIO ,"dirty_ratio" }, - {VM_DIRTY_WB_CS ,"dirty_writeback_centisecs" }, - {VM_DIRTY_EXPIRE_CS ,"dirty_expire_centisecs" }, - {VM_NR_PDFLUSH_THREADS ,"nr_pdflush_threads" }, - {VM_OVERCOMMIT_RATIO ,"overcommit_ratio" }, -/* VM_PAGEBUF unused */ - {VM_HUGETLB_PAGES ,"nr_hugepages" }, - {VM_SWAPPINESS ,"swappiness" }, - {VM_LOWMEM_RESERVE_RATIO ,"lowmem_reserve_ratio" }, - {VM_MIN_FREE_KBYTES ,"min_free_kbytes" }, - {VM_MAX_MAP_COUNT ,"max_map_count" }, - {VM_LAPTOP_MODE ,"laptop_mode" }, - {VM_BLOCK_DUMP ,"block_dump" }, - {VM_HUGETLB_GROUP ,"hugetlb_shm_group" }, - {VM_VFS_CACHE_PRESSURE ,"vfs_cache_pressure" }, - {VM_LEGACY_VA_LAYOUT ,"legacy_va_layout" }, -/* VM_SWAP_TOKEN_TIMEOUT unused */ - {VM_DROP_PAGECACHE ,"drop_caches" }, - {VM_PERCPU_PAGELIST_FRACTION ,"percpu_pagelist_fraction" }, - {VM_ZONE_RECLAIM_MODE ,"zone_reclaim_mode" }, - {VM_MIN_UNMAPPED ,"min_unmapped_ratio" }, - {VM_PANIC_ON_OOM ,"panic_on_oom" }, - {VM_VDSO_ENABLED ,"vdso_enabled" }, - {VM_MIN_SLAB ,"min_slab_ratio" }, - - {} -}; - -static const struct trans_ctl_table trans_net_core_table[] = { - {NET_CORE_WMEM_MAX ,"wmem_max" }, - {NET_CORE_RMEM_MAX ,"rmem_max" }, - {NET_CORE_WMEM_DEFAULT ,"wmem_default" }, - {NET_CORE_RMEM_DEFAULT ,"rmem_default" }, -/* NET_CORE_DESTROY_DELAY unused */ - {NET_CORE_MAX_BACKLOG ,"netdev_max_backlog" }, -/* NET_CORE_FASTROUTE unused */ - {NET_CORE_MSG_COST ,"message_cost" }, - {NET_CORE_MSG_BURST ,"message_burst" }, - {NET_CORE_OPTMEM_MAX ,"optmem_max" }, -/* NET_CORE_HOT_LIST_LENGTH unused */ -/* NET_CORE_DIVERT_VERSION unused */ -/* NET_CORE_NO_CONG_THRESH unused */ -/* NET_CORE_NO_CONG unused */ -/* NET_CORE_LO_CONG unused */ -/* NET_CORE_MOD_CONG unused */ - {NET_CORE_DEV_WEIGHT ,"dev_weight" }, - {NET_CORE_SOMAXCONN ,"somaxconn" }, - {NET_CORE_BUDGET ,"netdev_budget" }, - {NET_CORE_AEVENT_ETIME ,"xfrm_aevent_etime" }, - {NET_CORE_AEVENT_RSEQTH ,"xfrm_aevent_rseqth" }, - {NET_CORE_WARNINGS ,"warnings" }, - {}, -}; - -static const struct trans_ctl_table trans_net_unix_table[] = { -/* NET_UNIX_DESTROY_DELAY unused */ -/* NET_UNIX_DELETE_DELAY unused */ - {NET_UNIX_MAX_DGRAM_QLEN ,"max_dgram_qlen" }, - {} -}; - -static const struct trans_ctl_table trans_net_ipv4_route_table[] = { - {NET_IPV4_ROUTE_FLUSH ,"flush" }, - {NET_IPV4_ROUTE_MIN_DELAY ,"min_delay" }, - {NET_IPV4_ROUTE_MAX_DELAY ,"max_delay" }, - {NET_IPV4_ROUTE_GC_THRESH ,"gc_thresh" }, - {NET_IPV4_ROUTE_MAX_SIZE ,"max_size" }, - {NET_IPV4_ROUTE_GC_MIN_INTERVAL ,"gc_min_interval" }, - {NET_IPV4_ROUTE_GC_TIMEOUT ,"gc_timeout" }, - {NET_IPV4_ROUTE_GC_INTERVAL ,"gc_interval" }, - {NET_IPV4_ROUTE_REDIRECT_LOAD ,"redirect_load" }, - {NET_IPV4_ROUTE_REDIRECT_NUMBER ,"redirect_number" }, - {NET_IPV4_ROUTE_REDIRECT_SILENCE ,"redirect_silence" }, - {NET_IPV4_ROUTE_ERROR_COST ,"error_cost" }, - {NET_IPV4_ROUTE_ERROR_BURST ,"error_burst" }, - {NET_IPV4_ROUTE_GC_ELASTICITY ,"gc_elasticity" }, - {NET_IPV4_ROUTE_MTU_EXPIRES ,"mtu_expires" }, - {NET_IPV4_ROUTE_MIN_PMTU ,"min_pmtu" }, - {NET_IPV4_ROUTE_MIN_ADVMSS ,"min_adv_mss" }, - {NET_IPV4_ROUTE_SECRET_INTERVAL ,"secret_interval" }, - {NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS ,"gc_min_interval_ms" }, - {} -}; - -static const struct trans_ctl_table trans_net_ipv4_conf_vars_table[] = { - {NET_IPV4_CONF_FORWARDING ,"forwarding" }, - {NET_IPV4_CONF_MC_FORWARDING ,"mc_forwarding" }, - - {NET_IPV4_CONF_PROXY_ARP ,"proxy_arp" }, - {NET_IPV4_CONF_ACCEPT_REDIRECTS ,"accept_redirects" }, - {NET_IPV4_CONF_SECURE_REDIRECTS ,"secure_redirects" }, - {NET_IPV4_CONF_SEND_REDIRECTS ,"send_redirects" }, - {NET_IPV4_CONF_SHARED_MEDIA ,"shared_media" }, - {NET_IPV4_CONF_RP_FILTER ,"rp_filter" }, - {NET_IPV4_CONF_ACCEPT_SOURCE_ROUTE ,"accept_source_route" }, - {NET_IPV4_CONF_BOOTP_RELAY ,"bootp_relay" }, - {NET_IPV4_CONF_LOG_MARTIANS ,"log_martians" }, - {NET_IPV4_CONF_TAG ,"tag" }, - {NET_IPV4_CONF_ARPFILTER ,"arp_filter" }, - {NET_IPV4_CONF_MEDIUM_ID ,"medium_id" }, - {NET_IPV4_CONF_NOXFRM ,"disable_xfrm" }, - {NET_IPV4_CONF_NOPOLICY ,"disable_policy" }, - {NET_IPV4_CONF_FORCE_IGMP_VERSION ,"force_igmp_version" }, - - {NET_IPV4_CONF_ARP_ANNOUNCE ,"arp_announce" }, - {NET_IPV4_CONF_ARP_IGNORE ,"arp_ignore" }, - {NET_IPV4_CONF_PROMOTE_SECONDARIES ,"promote_secondaries" }, - {NET_IPV4_CONF_ARP_ACCEPT ,"arp_accept" }, - {NET_IPV4_CONF_ARP_NOTIFY ,"arp_notify" }, - {} -}; - -static const struct trans_ctl_table trans_net_ipv4_conf_table[] = { - {NET_PROTO_CONF_ALL ,"all" , trans_net_ipv4_conf_vars_table }, - {NET_PROTO_CONF_DEFAULT ,"default" , trans_net_ipv4_conf_vars_table }, - {0 ,NULL , trans_net_ipv4_conf_vars_table }, - {} -}; - -static const struct trans_ctl_table trans_net_neigh_vars_table[] = { - {NET_NEIGH_MCAST_SOLICIT ,"mcast_solicit" }, - {NET_NEIGH_UCAST_SOLICIT ,"ucast_solicit" }, - {NET_NEIGH_APP_SOLICIT ,"app_solicit" }, - {NET_NEIGH_RETRANS_TIME ,"retrans_time" }, - {NET_NEIGH_REACHABLE_TIME ,"base_reachable_time" }, - {NET_NEIGH_DELAY_PROBE_TIME ,"delay_first_probe_time" }, - {NET_NEIGH_GC_STALE_TIME ,"gc_stale_time" }, - {NET_NEIGH_UNRES_QLEN ,"unres_qlen" }, - {NET_NEIGH_PROXY_QLEN ,"proxy_qlen" }, - {NET_NEIGH_ANYCAST_DELAY ,"anycast_delay" }, - {NET_NEIGH_PROXY_DELAY ,"proxy_delay" }, - {NET_NEIGH_LOCKTIME ,"locktime" }, - {NET_NEIGH_GC_INTERVAL ,"gc_interval" }, - {NET_NEIGH_GC_THRESH1 ,"gc_thresh1" }, - {NET_NEIGH_GC_THRESH2 ,"gc_thresh2" }, - {NET_NEIGH_GC_THRESH3 ,"gc_thresh3" }, - {NET_NEIGH_RETRANS_TIME_MS ,"retrans_time_ms" }, - {NET_NEIGH_REACHABLE_TIME_MS ,"base_reachable_time_ms" }, - {} -}; - -static const struct trans_ctl_table trans_net_neigh_table[] = { - {NET_PROTO_CONF_DEFAULT ,"default" , trans_net_neigh_vars_table }, - {0 ,NULL , trans_net_neigh_vars_table }, - {} -}; - -static const struct trans_ctl_table trans_net_ipv4_netfilter_table[] = { - {NET_IPV4_NF_CONNTRACK_MAX ,"ip_conntrack_max" }, - - {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT ,"ip_conntrack_tcp_timeout_syn_sent" }, - {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV ,"ip_conntrack_tcp_timeout_syn_recv" }, - {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED ,"ip_conntrack_tcp_timeout_established" }, - {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT ,"ip_conntrack_tcp_timeout_fin_wait" }, - {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT ,"ip_conntrack_tcp_timeout_close_wait" }, - {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK ,"ip_conntrack_tcp_timeout_last_ack" }, - {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT ,"ip_conntrack_tcp_timeout_time_wait" }, - {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_CLOSE ,"ip_conntrack_tcp_timeout_close" }, - - {NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT ,"ip_conntrack_udp_timeout" }, - {NET_IPV4_NF_CONNTRACK_UDP_TIMEOUT_STREAM ,"ip_conntrack_udp_timeout_stream" }, - {NET_IPV4_NF_CONNTRACK_ICMP_TIMEOUT ,"ip_conntrack_icmp_timeout" }, - {NET_IPV4_NF_CONNTRACK_GENERIC_TIMEOUT ,"ip_conntrack_generic_timeout" }, - - {NET_IPV4_NF_CONNTRACK_BUCKETS ,"ip_conntrack_buckets" }, - {NET_IPV4_NF_CONNTRACK_LOG_INVALID ,"ip_conntrack_log_invalid" }, - {NET_IPV4_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS ,"ip_conntrack_tcp_timeout_max_retrans" }, - {NET_IPV4_NF_CONNTRACK_TCP_LOOSE ,"ip_conntrack_tcp_loose" }, - {NET_IPV4_NF_CONNTRACK_TCP_BE_LIBERAL ,"ip_conntrack_tcp_be_liberal" }, - {NET_IPV4_NF_CONNTRACK_TCP_MAX_RETRANS ,"ip_conntrack_tcp_max_retrans" }, - - {NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED ,"ip_conntrack_sctp_timeout_closed" }, - {NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT ,"ip_conntrack_sctp_timeout_cookie_wait" }, - {NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED ,"ip_conntrack_sctp_timeout_cookie_echoed" }, - {NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED ,"ip_conntrack_sctp_timeout_established" }, - {NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT ,"ip_conntrack_sctp_timeout_shutdown_sent" }, - {NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD ,"ip_conntrack_sctp_timeout_shutdown_recd" }, - {NET_IPV4_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT ,"ip_conntrack_sctp_timeout_shutdown_ack_sent" }, - - {NET_IPV4_NF_CONNTRACK_COUNT ,"ip_conntrack_count" }, - {NET_IPV4_NF_CONNTRACK_CHECKSUM ,"ip_conntrack_checksum" }, - {} -}; - -static const struct trans_ctl_table trans_net_ipv4_table[] = { - {NET_IPV4_FORWARD ,"ip_forward" }, - {NET_IPV4_DYNADDR ,"ip_dynaddr" }, - - {NET_IPV4_CONF ,"conf" , trans_net_ipv4_conf_table }, - {NET_IPV4_NEIGH ,"neigh" , trans_net_neigh_table }, - {NET_IPV4_ROUTE ,"route" , trans_net_ipv4_route_table }, -/* NET_IPV4_FIB_HASH unused */ - {NET_IPV4_NETFILTER ,"netfilter" , trans_net_ipv4_netfilter_table }, - - {NET_IPV4_TCP_TIMESTAMPS ,"tcp_timestamps" }, - {NET_IPV4_TCP_WINDOW_SCALING ,"tcp_window_scaling" }, - {NET_IPV4_TCP_SACK ,"tcp_sack" }, - {NET_IPV4_TCP_RETRANS_COLLAPSE ,"tcp_retrans_collapse" }, - {NET_IPV4_DEFAULT_TTL ,"ip_default_ttl" }, -/* NET_IPV4_AUTOCONFIG unused */ - {NET_IPV4_NO_PMTU_DISC ,"ip_no_pmtu_disc" }, - {NET_IPV4_TCP_SYN_RETRIES ,"tcp_syn_retries" }, - {NET_IPV4_IPFRAG_HIGH_THRESH ,"ipfrag_high_thresh" }, - {NET_IPV4_IPFRAG_LOW_THRESH ,"ipfrag_low_thresh" }, - {NET_IPV4_IPFRAG_TIME ,"ipfrag_time" }, -/* NET_IPV4_TCP_MAX_KA_PROBES unused */ - {NET_IPV4_TCP_KEEPALIVE_TIME ,"tcp_keepalive_time" }, - {NET_IPV4_TCP_KEEPALIVE_PROBES ,"tcp_keepalive_probes" }, - {NET_IPV4_TCP_RETRIES1 ,"tcp_retries1" }, - {NET_IPV4_TCP_RETRIES2 ,"tcp_retries2" }, - {NET_IPV4_TCP_FIN_TIMEOUT ,"tcp_fin_timeout" }, -/* NET_IPV4_IP_MASQ_DEBUG unused */ - {NET_TCP_SYNCOOKIES ,"tcp_syncookies" }, - {NET_TCP_STDURG ,"tcp_stdurg" }, - {NET_TCP_RFC1337 ,"tcp_rfc1337" }, -/* NET_TCP_SYN_TAILDROP unused */ - {NET_TCP_MAX_SYN_BACKLOG ,"tcp_max_syn_backlog" }, - {NET_IPV4_LOCAL_PORT_RANGE ,"ip_local_port_range" }, - {NET_IPV4_ICMP_ECHO_IGNORE_ALL ,"icmp_echo_ignore_all" }, - {NET_IPV4_ICMP_ECHO_IGNORE_BROADCASTS ,"icmp_echo_ignore_broadcasts" }, -/* NET_IPV4_ICMP_SOURCEQUENCH_RATE unused */ -/* NET_IPV4_ICMP_DESTUNREACH_RATE unused */ -/* NET_IPV4_ICMP_TIMEEXCEED_RATE unused */ -/* NET_IPV4_ICMP_PARAMPROB_RATE unused */ -/* NET_IPV4_ICMP_ECHOREPLY_RATE unused */ - {NET_IPV4_ICMP_IGNORE_BOGUS_ERROR_RESPONSES ,"icmp_ignore_bogus_error_responses" }, - {NET_IPV4_IGMP_MAX_MEMBERSHIPS ,"igmp_max_memberships" }, - {NET_TCP_TW_RECYCLE ,"tcp_tw_recycle" }, -/* NET_IPV4_ALWAYS_DEFRAG unused */ - {NET_IPV4_TCP_KEEPALIVE_INTVL ,"tcp_keepalive_intvl" }, - {NET_IPV4_INET_PEER_THRESHOLD ,"inet_peer_threshold" }, - {NET_IPV4_INET_PEER_MINTTL ,"inet_peer_minttl" }, - {NET_IPV4_INET_PEER_MAXTTL ,"inet_peer_maxttl" }, - {NET_IPV4_INET_PEER_GC_MINTIME ,"inet_peer_gc_mintime" }, - {NET_IPV4_INET_PEER_GC_MAXTIME ,"inet_peer_gc_maxtime" }, - {NET_TCP_ORPHAN_RETRIES ,"tcp_orphan_retries" }, - {NET_TCP_ABORT_ON_OVERFLOW ,"tcp_abort_on_overflow" }, - {NET_TCP_SYNACK_RETRIES ,"tcp_synack_retries" }, - {NET_TCP_MAX_ORPHANS ,"tcp_max_orphans" }, - {NET_TCP_MAX_TW_BUCKETS ,"tcp_max_tw_buckets" }, - {NET_TCP_FACK ,"tcp_fack" }, - {NET_TCP_REORDERING ,"tcp_reordering" }, - {NET_TCP_ECN ,"tcp_ecn" }, - {NET_TCP_DSACK ,"tcp_dsack" }, - {NET_TCP_MEM ,"tcp_mem" }, - {NET_TCP_WMEM ,"tcp_wmem" }, - {NET_TCP_RMEM ,"tcp_rmem" }, - {NET_TCP_APP_WIN ,"tcp_app_win" }, - {NET_TCP_ADV_WIN_SCALE ,"tcp_adv_win_scale" }, - {NET_IPV4_NONLOCAL_BIND ,"ip_nonlocal_bind" }, - {NET_IPV4_ICMP_RATELIMIT ,"icmp_ratelimit" }, - {NET_IPV4_ICMP_RATEMASK ,"icmp_ratemask" }, - {NET_TCP_TW_REUSE ,"tcp_tw_reuse" }, - {NET_TCP_FRTO ,"tcp_frto" }, - {NET_TCP_LOW_LATENCY ,"tcp_low_latency" }, - {NET_IPV4_IPFRAG_SECRET_INTERVAL ,"ipfrag_secret_interval" }, - {NET_IPV4_IGMP_MAX_MSF ,"igmp_max_msf" }, - {NET_TCP_NO_METRICS_SAVE ,"tcp_no_metrics_save" }, -/* NET_TCP_DEFAULT_WIN_SCALE unused */ - {NET_TCP_MODERATE_RCVBUF ,"tcp_moderate_rcvbuf" }, - {NET_TCP_TSO_WIN_DIVISOR ,"tcp_tso_win_divisor" }, -/* NET_TCP_BIC_BETA unused */ - {NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR ,"icmp_errors_use_inbound_ifaddr" }, - {NET_TCP_CONG_CONTROL ,"tcp_congestion_control" }, - {NET_TCP_ABC ,"tcp_abc" }, - {NET_IPV4_IPFRAG_MAX_DIST ,"ipfrag_max_dist" }, - {NET_TCP_MTU_PROBING ,"tcp_mtu_probing" }, - {NET_TCP_BASE_MSS ,"tcp_base_mss" }, - {NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS ,"tcp_workaround_signed_windows" }, - {NET_TCP_DMA_COPYBREAK ,"tcp_dma_copybreak" }, - {NET_TCP_SLOW_START_AFTER_IDLE ,"tcp_slow_start_after_idle" }, - {NET_CIPSOV4_CACHE_ENABLE ,"cipso_cache_enable" }, - {NET_CIPSOV4_CACHE_BUCKET_SIZE ,"cipso_cache_bucket_size" }, - {NET_CIPSOV4_RBM_OPTFMT ,"cipso_rbm_optfmt" }, - {NET_CIPSOV4_RBM_STRICTVALID ,"cipso_rbm_strictvalid" }, - {NET_TCP_AVAIL_CONG_CONTROL ,"tcp_available_congestion_control" }, - {NET_TCP_ALLOWED_CONG_CONTROL ,"tcp_allowed_congestion_control" }, - {NET_TCP_MAX_SSTHRESH ,"tcp_max_ssthresh" }, - {NET_TCP_FRTO_RESPONSE ,"tcp_frto_response" }, - {2088 /* NET_IPQ_QMAX */ ,"ip_queue_maxlen" }, - {} -}; - -static const struct trans_ctl_table trans_net_ipx_table[] = { - {NET_IPX_PPROP_BROADCASTING ,"ipx_pprop_broadcasting" }, -/* NET_IPX_FORWARDING unused */ - {} -}; - -static const struct trans_ctl_table trans_net_atalk_table[] = { - {NET_ATALK_AARP_EXPIRY_TIME ,"aarp-expiry-time" }, - {NET_ATALK_AARP_TICK_TIME ,"aarp-tick-time" }, - {NET_ATALK_AARP_RETRANSMIT_LIMIT ,"aarp-retransmit-limit" }, - {NET_ATALK_AARP_RESOLVE_TIME ,"aarp-resolve-time" }, - {}, -}; - -static const struct trans_ctl_table trans_net_netrom_table[] = { - {NET_NETROM_DEFAULT_PATH_QUALITY ,"default_path_quality" }, - {NET_NETROM_OBSOLESCENCE_COUNT_INITIALISER ,"obsolescence_count_initialiser" }, - {NET_NETROM_NETWORK_TTL_INITIALISER ,"network_ttl_initialiser" }, - {NET_NETROM_TRANSPORT_TIMEOUT ,"transport_timeout" }, - {NET_NETROM_TRANSPORT_MAXIMUM_TRIES ,"transport_maximum_tries" }, - {NET_NETROM_TRANSPORT_ACKNOWLEDGE_DELAY ,"transport_acknowledge_delay" }, - {NET_NETROM_TRANSPORT_BUSY_DELAY ,"transport_busy_delay" }, - {NET_NETROM_TRANSPORT_REQUESTED_WINDOW_SIZE ,"transport_requested_window_size" }, - {NET_NETROM_TRANSPORT_NO_ACTIVITY_TIMEOUT ,"transport_no_activity_timeout" }, - {NET_NETROM_ROUTING_CONTROL ,"routing_control" }, - {NET_NETROM_LINK_FAILS_COUNT ,"link_fails_count" }, - {NET_NETROM_RESET ,"reset" }, - {} -}; - -static const struct trans_ctl_table trans_net_ax25_param_table[] = { - {NET_AX25_IP_DEFAULT_MODE ,"ip_default_mode" }, - {NET_AX25_DEFAULT_MODE ,"ax25_default_mode" }, - {NET_AX25_BACKOFF_TYPE ,"backoff_type" }, - {NET_AX25_CONNECT_MODE ,"connect_mode" }, - {NET_AX25_STANDARD_WINDOW ,"standard_window_size" }, - {NET_AX25_EXTENDED_WINDOW ,"extended_window_size" }, - {NET_AX25_T1_TIMEOUT ,"t1_timeout" }, - {NET_AX25_T2_TIMEOUT ,"t2_timeout" }, - {NET_AX25_T3_TIMEOUT ,"t3_timeout" }, - {NET_AX25_IDLE_TIMEOUT ,"idle_timeout" }, - {NET_AX25_N2 ,"maximum_retry_count" }, - {NET_AX25_PACLEN ,"maximum_packet_length" }, - {NET_AX25_PROTOCOL ,"protocol" }, - {NET_AX25_DAMA_SLAVE_TIMEOUT ,"dama_slave_timeout" }, - {} -}; - -static const struct trans_ctl_table trans_net_ax25_table[] = { - {0 ,NULL , trans_net_ax25_param_table }, - {} -}; - -static const struct trans_ctl_table trans_net_bridge_table[] = { - {NET_BRIDGE_NF_CALL_ARPTABLES ,"bridge-nf-call-arptables" }, - {NET_BRIDGE_NF_CALL_IPTABLES ,"bridge-nf-call-iptables" }, - {NET_BRIDGE_NF_CALL_IP6TABLES ,"bridge-nf-call-ip6tables" }, - {NET_BRIDGE_NF_FILTER_VLAN_TAGGED ,"bridge-nf-filter-vlan-tagged" }, - {NET_BRIDGE_NF_FILTER_PPPOE_TAGGED ,"bridge-nf-filter-pppoe-tagged" }, - {} -}; - -static const struct trans_ctl_table trans_net_rose_table[] = { - {NET_ROSE_RESTART_REQUEST_TIMEOUT ,"restart_request_timeout" }, - {NET_ROSE_CALL_REQUEST_TIMEOUT ,"call_request_timeout" }, - {NET_ROSE_RESET_REQUEST_TIMEOUT ,"reset_request_timeout" }, - {NET_ROSE_CLEAR_REQUEST_TIMEOUT ,"clear_request_timeout" }, - {NET_ROSE_ACK_HOLD_BACK_TIMEOUT ,"acknowledge_hold_back_timeout" }, - {NET_ROSE_ROUTING_CONTROL ,"routing_control" }, - {NET_ROSE_LINK_FAIL_TIMEOUT ,"link_fail_timeout" }, - {NET_ROSE_MAX_VCS ,"maximum_virtual_circuits" }, - {NET_ROSE_WINDOW_SIZE ,"window_size" }, - {NET_ROSE_NO_ACTIVITY_TIMEOUT ,"no_activity_timeout" }, - {} -}; - -static const struct trans_ctl_table trans_net_ipv6_conf_var_table[] = { - {NET_IPV6_FORWARDING ,"forwarding" }, - {NET_IPV6_HOP_LIMIT ,"hop_limit" }, - {NET_IPV6_MTU ,"mtu" }, - {NET_IPV6_ACCEPT_RA ,"accept_ra" }, - {NET_IPV6_ACCEPT_REDIRECTS ,"accept_redirects" }, - {NET_IPV6_AUTOCONF ,"autoconf" }, - {NET_IPV6_DAD_TRANSMITS ,"dad_transmits" }, - {NET_IPV6_RTR_SOLICITS ,"router_solicitations" }, - {NET_IPV6_RTR_SOLICIT_INTERVAL ,"router_solicitation_interval" }, - {NET_IPV6_RTR_SOLICIT_DELAY ,"router_solicitation_delay" }, - {NET_IPV6_USE_TEMPADDR ,"use_tempaddr" }, - {NET_IPV6_TEMP_VALID_LFT ,"temp_valid_lft" }, - {NET_IPV6_TEMP_PREFERED_LFT ,"temp_prefered_lft" }, - {NET_IPV6_REGEN_MAX_RETRY ,"regen_max_retry" }, - {NET_IPV6_MAX_DESYNC_FACTOR ,"max_desync_factor" }, - {NET_IPV6_MAX_ADDRESSES ,"max_addresses" }, - {NET_IPV6_FORCE_MLD_VERSION ,"force_mld_version" }, - {NET_IPV6_ACCEPT_RA_DEFRTR ,"accept_ra_defrtr" }, - {NET_IPV6_ACCEPT_RA_PINFO ,"accept_ra_pinfo" }, - {NET_IPV6_ACCEPT_RA_RTR_PREF ,"accept_ra_rtr_pref" }, - {NET_IPV6_RTR_PROBE_INTERVAL ,"router_probe_interval" }, - {NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN ,"accept_ra_rt_info_max_plen" }, - {NET_IPV6_PROXY_NDP ,"proxy_ndp" }, - {NET_IPV6_ACCEPT_SOURCE_ROUTE ,"accept_source_route" }, - {} -}; - -static const struct trans_ctl_table trans_net_ipv6_conf_table[] = { - {NET_PROTO_CONF_ALL ,"all" , trans_net_ipv6_conf_var_table }, - {NET_PROTO_CONF_DEFAULT ,"default" , trans_net_ipv6_conf_var_table }, - {0 ,NULL , trans_net_ipv6_conf_var_table }, - {} -}; - -static const struct trans_ctl_table trans_net_ipv6_route_table[] = { - {NET_IPV6_ROUTE_FLUSH ,"flush" }, - {NET_IPV6_ROUTE_GC_THRESH ,"gc_thresh" }, - {NET_IPV6_ROUTE_MAX_SIZE ,"max_size" }, - {NET_IPV6_ROUTE_GC_MIN_INTERVAL ,"gc_min_interval" }, - {NET_IPV6_ROUTE_GC_TIMEOUT ,"gc_timeout" }, - {NET_IPV6_ROUTE_GC_INTERVAL ,"gc_interval" }, - {NET_IPV6_ROUTE_GC_ELASTICITY ,"gc_elasticity" }, - {NET_IPV6_ROUTE_MTU_EXPIRES ,"mtu_expires" }, - {NET_IPV6_ROUTE_MIN_ADVMSS ,"min_adv_mss" }, - {NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS ,"gc_min_interval_ms" }, - {} -}; - -static const struct trans_ctl_table trans_net_ipv6_icmp_table[] = { - {NET_IPV6_ICMP_RATELIMIT ,"ratelimit" }, - {} -}; - -static const struct trans_ctl_table trans_net_ipv6_table[] = { - {NET_IPV6_CONF ,"conf" , trans_net_ipv6_conf_table }, - {NET_IPV6_NEIGH ,"neigh" , trans_net_neigh_table }, - {NET_IPV6_ROUTE ,"route" , trans_net_ipv6_route_table }, - {NET_IPV6_ICMP ,"icmp" , trans_net_ipv6_icmp_table }, - {NET_IPV6_BINDV6ONLY ,"bindv6only" }, - {NET_IPV6_IP6FRAG_HIGH_THRESH ,"ip6frag_high_thresh" }, - {NET_IPV6_IP6FRAG_LOW_THRESH ,"ip6frag_low_thresh" }, - {NET_IPV6_IP6FRAG_TIME ,"ip6frag_time" }, - {NET_IPV6_IP6FRAG_SECRET_INTERVAL ,"ip6frag_secret_interval" }, - {NET_IPV6_MLD_MAX_MSF ,"mld_max_msf" }, - {2088 /* IPQ_QMAX */ ,"ip6_queue_maxlen" }, - {} -}; - -static const struct trans_ctl_table trans_net_x25_table[] = { - {NET_X25_RESTART_REQUEST_TIMEOUT ,"restart_request_timeout" }, - {NET_X25_CALL_REQUEST_TIMEOUT ,"call_request_timeout" }, - {NET_X25_RESET_REQUEST_TIMEOUT ,"reset_request_timeout" }, - {NET_X25_CLEAR_REQUEST_TIMEOUT ,"clear_request_timeout" }, - {NET_X25_ACK_HOLD_BACK_TIMEOUT ,"acknowledgement_hold_back_timeout" }, - {NET_X25_FORWARD ,"x25_forward" }, - {} -}; - -static const struct trans_ctl_table trans_net_tr_table[] = { - {NET_TR_RIF_TIMEOUT ,"rif_timeout" }, - {} -}; - - -static const struct trans_ctl_table trans_net_decnet_conf_vars[] = { - {NET_DECNET_CONF_DEV_FORWARDING ,"forwarding" }, - {NET_DECNET_CONF_DEV_PRIORITY ,"priority" }, - {NET_DECNET_CONF_DEV_T2 ,"t2" }, - {NET_DECNET_CONF_DEV_T3 ,"t3" }, - {} -}; - -static const struct trans_ctl_table trans_net_decnet_conf[] = { - {0 ,NULL , trans_net_decnet_conf_vars }, - {} -}; - -static const struct trans_ctl_table trans_net_decnet_table[] = { - {NET_DECNET_CONF ,"conf" , trans_net_decnet_conf }, - {NET_DECNET_NODE_ADDRESS ,"node_address" }, - {NET_DECNET_NODE_NAME ,"node_name" }, - {NET_DECNET_DEFAULT_DEVICE ,"default_device" }, - {NET_DECNET_TIME_WAIT ,"time_wait" }, - {NET_DECNET_DN_COUNT ,"dn_count" }, - {NET_DECNET_DI_COUNT ,"di_count" }, - {NET_DECNET_DR_COUNT ,"dr_count" }, - {NET_DECNET_DST_GC_INTERVAL ,"dst_gc_interval" }, - {NET_DECNET_NO_FC_MAX_CWND ,"no_fc_max_cwnd" }, - {NET_DECNET_MEM ,"decnet_mem" }, - {NET_DECNET_RMEM ,"decnet_rmem" }, - {NET_DECNET_WMEM ,"decnet_wmem" }, - {NET_DECNET_DEBUG_LEVEL ,"debug" }, - {} -}; - -static const struct trans_ctl_table trans_net_sctp_table[] = { - {NET_SCTP_RTO_INITIAL ,"rto_initial" }, - {NET_SCTP_RTO_MIN ,"rto_min" }, - {NET_SCTP_RTO_MAX ,"rto_max" }, - {NET_SCTP_RTO_ALPHA ,"rto_alpha_exp_divisor" }, - {NET_SCTP_RTO_BETA ,"rto_beta_exp_divisor" }, - {NET_SCTP_VALID_COOKIE_LIFE ,"valid_cookie_life" }, - {NET_SCTP_ASSOCIATION_MAX_RETRANS ,"association_max_retrans" }, - {NET_SCTP_PATH_MAX_RETRANS ,"path_max_retrans" }, - {NET_SCTP_MAX_INIT_RETRANSMITS ,"max_init_retransmits" }, - {NET_SCTP_HB_INTERVAL ,"hb_interval" }, - {NET_SCTP_PRESERVE_ENABLE ,"cookie_preserve_enable" }, - {NET_SCTP_MAX_BURST ,"max_burst" }, - {NET_SCTP_ADDIP_ENABLE ,"addip_enable" }, - {NET_SCTP_PRSCTP_ENABLE ,"prsctp_enable" }, - {NET_SCTP_SNDBUF_POLICY ,"sndbuf_policy" }, - {NET_SCTP_SACK_TIMEOUT ,"sack_timeout" }, - {NET_SCTP_RCVBUF_POLICY ,"rcvbuf_policy" }, - {} -}; - -static const struct trans_ctl_table trans_net_llc_llc2_timeout_table[] = { - {NET_LLC2_ACK_TIMEOUT ,"ack" }, - {NET_LLC2_P_TIMEOUT ,"p" }, - {NET_LLC2_REJ_TIMEOUT ,"rej" }, - {NET_LLC2_BUSY_TIMEOUT ,"busy" }, - {} -}; - -static const struct trans_ctl_table trans_net_llc_station_table[] = { - {NET_LLC_STATION_ACK_TIMEOUT ,"ack_timeout" }, - {} -}; - -static const struct trans_ctl_table trans_net_llc_llc2_table[] = { - {NET_LLC2 ,"timeout" , trans_net_llc_llc2_timeout_table }, - {} -}; - -static const struct trans_ctl_table trans_net_llc_table[] = { - {NET_LLC2 ,"llc2" , trans_net_llc_llc2_table }, - {NET_LLC_STATION ,"station" , trans_net_llc_station_table }, - {} -}; - -static const struct trans_ctl_table trans_net_netfilter_table[] = { - {NET_NF_CONNTRACK_MAX ,"nf_conntrack_max" }, - {NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_SENT ,"nf_conntrack_tcp_timeout_syn_sent" }, - {NET_NF_CONNTRACK_TCP_TIMEOUT_SYN_RECV ,"nf_conntrack_tcp_timeout_syn_recv" }, - {NET_NF_CONNTRACK_TCP_TIMEOUT_ESTABLISHED ,"nf_conntrack_tcp_timeout_established" }, - {NET_NF_CONNTRACK_TCP_TIMEOUT_FIN_WAIT ,"nf_conntrack_tcp_timeout_fin_wait" }, - {NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE_WAIT ,"nf_conntrack_tcp_timeout_close_wait" }, - {NET_NF_CONNTRACK_TCP_TIMEOUT_LAST_ACK ,"nf_conntrack_tcp_timeout_last_ack" }, - {NET_NF_CONNTRACK_TCP_TIMEOUT_TIME_WAIT ,"nf_conntrack_tcp_timeout_time_wait" }, - {NET_NF_CONNTRACK_TCP_TIMEOUT_CLOSE ,"nf_conntrack_tcp_timeout_close" }, - {NET_NF_CONNTRACK_UDP_TIMEOUT ,"nf_conntrack_udp_timeout" }, - {NET_NF_CONNTRACK_UDP_TIMEOUT_STREAM ,"nf_conntrack_udp_timeout_stream" }, - {NET_NF_CONNTRACK_ICMP_TIMEOUT ,"nf_conntrack_icmp_timeout" }, - {NET_NF_CONNTRACK_GENERIC_TIMEOUT ,"nf_conntrack_generic_timeout" }, - {NET_NF_CONNTRACK_BUCKETS ,"nf_conntrack_buckets" }, - {NET_NF_CONNTRACK_LOG_INVALID ,"nf_conntrack_log_invalid" }, - {NET_NF_CONNTRACK_TCP_TIMEOUT_MAX_RETRANS ,"nf_conntrack_tcp_timeout_max_retrans" }, - {NET_NF_CONNTRACK_TCP_LOOSE ,"nf_conntrack_tcp_loose" }, - {NET_NF_CONNTRACK_TCP_BE_LIBERAL ,"nf_conntrack_tcp_be_liberal" }, - {NET_NF_CONNTRACK_TCP_MAX_RETRANS ,"nf_conntrack_tcp_max_retrans" }, - {NET_NF_CONNTRACK_SCTP_TIMEOUT_CLOSED ,"nf_conntrack_sctp_timeout_closed" }, - {NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_WAIT ,"nf_conntrack_sctp_timeout_cookie_wait" }, - {NET_NF_CONNTRACK_SCTP_TIMEOUT_COOKIE_ECHOED ,"nf_conntrack_sctp_timeout_cookie_echoed" }, - {NET_NF_CONNTRACK_SCTP_TIMEOUT_ESTABLISHED ,"nf_conntrack_sctp_timeout_established" }, - {NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_SENT ,"nf_conntrack_sctp_timeout_shutdown_sent" }, - {NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_RECD ,"nf_conntrack_sctp_timeout_shutdown_recd" }, - {NET_NF_CONNTRACK_SCTP_TIMEOUT_SHUTDOWN_ACK_SENT ,"nf_conntrack_sctp_timeout_shutdown_ack_sent" }, - {NET_NF_CONNTRACK_COUNT ,"nf_conntrack_count" }, - {NET_NF_CONNTRACK_ICMPV6_TIMEOUT ,"nf_conntrack_icmpv6_timeout" }, - {NET_NF_CONNTRACK_FRAG6_TIMEOUT ,"nf_conntrack_frag6_timeout" }, - {NET_NF_CONNTRACK_FRAG6_LOW_THRESH ,"nf_conntrack_frag6_low_thresh" }, - {NET_NF_CONNTRACK_FRAG6_HIGH_THRESH ,"nf_conntrack_frag6_high_thresh" }, - {NET_NF_CONNTRACK_CHECKSUM ,"nf_conntrack_checksum" }, - - {} -}; - -static const struct trans_ctl_table trans_net_dccp_table[] = { - {NET_DCCP_DEFAULT ,"default" }, - {} -}; - -static const struct trans_ctl_table trans_net_irda_table[] = { - {NET_IRDA_DISCOVERY ,"discovery" }, - {NET_IRDA_DEVNAME ,"devname" }, - {NET_IRDA_DEBUG ,"debug" }, - {NET_IRDA_FAST_POLL ,"fast_poll_increase" }, - {NET_IRDA_DISCOVERY_SLOTS ,"discovery_slots" }, - {NET_IRDA_DISCOVERY_TIMEOUT ,"discovery_timeout" }, - {NET_IRDA_SLOT_TIMEOUT ,"slot_timeout" }, - {NET_IRDA_MAX_BAUD_RATE ,"max_baud_rate" }, - {NET_IRDA_MIN_TX_TURN_TIME ,"min_tx_turn_time" }, - {NET_IRDA_MAX_TX_DATA_SIZE ,"max_tx_data_size" }, - {NET_IRDA_MAX_TX_WINDOW ,"max_tx_window" }, - {NET_IRDA_MAX_NOREPLY_TIME ,"max_noreply_time" }, - {NET_IRDA_WARN_NOREPLY_TIME ,"warn_noreply_time" }, - {NET_IRDA_LAP_KEEPALIVE_TIME ,"lap_keepalive_time" }, - {} -}; - -static const struct trans_ctl_table trans_net_table[] = { - {NET_CORE ,"core" , trans_net_core_table }, -/* NET_ETHER not used */ -/* NET_802 not used */ - {NET_UNIX ,"unix" , trans_net_unix_table }, - {NET_IPV4 ,"ipv4" , trans_net_ipv4_table }, - {NET_IPX ,"ipx" , trans_net_ipx_table }, - {NET_ATALK ,"appletalk" , trans_net_atalk_table }, - {NET_NETROM ,"netrom" , trans_net_netrom_table }, - {NET_AX25 ,"ax25" , trans_net_ax25_table }, - {NET_BRIDGE ,"bridge" , trans_net_bridge_table }, - {NET_ROSE ,"rose" , trans_net_rose_table }, - {NET_IPV6 ,"ipv6" , trans_net_ipv6_table }, - {NET_X25 ,"x25" , trans_net_x25_table }, - {NET_TR ,"token-ring" , trans_net_tr_table }, - {NET_DECNET ,"decnet" , trans_net_decnet_table }, -/* NET_ECONET not used */ - {NET_SCTP ,"sctp" , trans_net_sctp_table }, - {NET_LLC ,"llc" , trans_net_llc_table }, - {NET_NETFILTER ,"netfilter" , trans_net_netfilter_table }, - {NET_DCCP ,"dccp" , trans_net_dccp_table }, - {NET_IRDA ,"irda" , trans_net_irda_table }, - {2089 ,"nf_conntrack_max" }, - {} -}; - -static const struct trans_ctl_table trans_fs_quota_table[] = { - {FS_DQ_LOOKUPS ,"lookups" }, - {FS_DQ_DROPS ,"drops" }, - {FS_DQ_READS ,"reads" }, - {FS_DQ_WRITES ,"writes" }, - {FS_DQ_CACHE_HITS ,"cache_hits" }, - {FS_DQ_ALLOCATED ,"allocated_dquots" }, - {FS_DQ_FREE ,"free_dquots" }, - {FS_DQ_SYNCS ,"syncs" }, - {FS_DQ_WARNINGS ,"warnings" }, - {} -}; - -static const struct trans_ctl_table trans_fs_xfs_table[] = { - {XFS_SGID_INHERIT ,"irix_sgid_inherit" }, - {XFS_SYMLINK_MODE ,"irix_symlink_mode" }, - {XFS_PANIC_MASK ,"panic_mask" }, - - {XFS_ERRLEVEL ,"error_level" }, - {XFS_SYNCD_TIMER ,"xfssyncd_centisecs" }, - {XFS_INHERIT_SYNC ,"inherit_sync" }, - {XFS_INHERIT_NODUMP ,"inherit_nodump" }, - {XFS_INHERIT_NOATIME ,"inherit_noatime" }, - {XFS_BUF_TIMER ,"xfsbufd_centisecs" }, - {XFS_BUF_AGE ,"age_buffer_centisecs" }, - {XFS_INHERIT_NOSYM ,"inherit_nosymlinks" }, - {XFS_ROTORSTEP ,"rotorstep" }, - {XFS_INHERIT_NODFRG ,"inherit_nodefrag" }, - {XFS_FILESTREAM_TIMER ,"filestream_centisecs" }, - {XFS_STATS_CLEAR ,"stats_clear" }, - {} -}; - -static const struct trans_ctl_table trans_fs_ocfs2_nm_table[] = { - {1 ,"hb_ctl_path" }, - {} -}; - -static const struct trans_ctl_table trans_fs_ocfs2_table[] = { - {1 ,"nm" , trans_fs_ocfs2_nm_table }, - {} -}; - -static const struct trans_ctl_table trans_inotify_table[] = { - {INOTIFY_MAX_USER_INSTANCES ,"max_user_instances" }, - {INOTIFY_MAX_USER_WATCHES ,"max_user_watches" }, - {INOTIFY_MAX_QUEUED_EVENTS ,"max_queued_events" }, - {} -}; - -static const struct trans_ctl_table trans_fs_table[] = { - {FS_NRINODE ,"inode-nr" }, - {FS_STATINODE ,"inode-state" }, -/* FS_MAXINODE unused */ -/* FS_NRDQUOT unused */ -/* FS_MAXDQUOT unused */ - {FS_NRFILE ,"file-nr" }, - {FS_MAXFILE ,"file-max" }, - {FS_DENTRY ,"dentry-state" }, -/* FS_NRSUPER unused */ -/* FS_MAXUPSER unused */ - {FS_OVERFLOWUID ,"overflowuid" }, - {FS_OVERFLOWGID ,"overflowgid" }, - {FS_LEASES ,"leases-enable" }, - {FS_DIR_NOTIFY ,"dir-notify-enable" }, - {FS_LEASE_TIME ,"lease-break-time" }, - {FS_DQSTATS ,"quota" , trans_fs_quota_table }, - {FS_XFS ,"xfs" , trans_fs_xfs_table }, - {FS_AIO_NR ,"aio-nr" }, - {FS_AIO_MAX_NR ,"aio-max-nr" }, - {FS_INOTIFY ,"inotify" , trans_inotify_table }, - {FS_OCFS2 ,"ocfs2" , trans_fs_ocfs2_table }, - {KERN_SETUID_DUMPABLE ,"suid_dumpable" }, - {} -}; - -static const struct trans_ctl_table trans_debug_table[] = { - {} -}; - -static const struct trans_ctl_table trans_cdrom_table[] = { - {DEV_CDROM_INFO ,"info" }, - {DEV_CDROM_AUTOCLOSE ,"autoclose" }, - {DEV_CDROM_AUTOEJECT ,"autoeject" }, - {DEV_CDROM_DEBUG ,"debug" }, - {DEV_CDROM_LOCK ,"lock" }, - {DEV_CDROM_CHECK_MEDIA ,"check_media" }, - {} -}; - -static const struct trans_ctl_table trans_ipmi_table[] = { - {DEV_IPMI_POWEROFF_POWERCYCLE ,"poweroff_powercycle" }, - {} -}; - -static const struct trans_ctl_table trans_mac_hid_files[] = { -/* DEV_MAC_HID_KEYBOARD_SENDS_LINUX_KEYCODES unused */ -/* DEV_MAC_HID_KEYBOARD_LOCK_KEYCODES unused */ - {DEV_MAC_HID_MOUSE_BUTTON_EMULATION ,"mouse_button_emulation" }, - {DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE ,"mouse_button2_keycode" }, - {DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE ,"mouse_button3_keycode" }, -/* DEV_MAC_HID_ADB_MOUSE_SENDS_KEYCODES unused */ - {} -}; - -static const struct trans_ctl_table trans_raid_table[] = { - {DEV_RAID_SPEED_LIMIT_MIN ,"speed_limit_min" }, - {DEV_RAID_SPEED_LIMIT_MAX ,"speed_limit_max" }, - {} -}; - -static const struct trans_ctl_table trans_scsi_table[] = { - {DEV_SCSI_LOGGING_LEVEL ,"logging_level" }, - {} -}; - -static const struct trans_ctl_table trans_parport_default_table[] = { - {DEV_PARPORT_DEFAULT_TIMESLICE ,"timeslice" }, - {DEV_PARPORT_DEFAULT_SPINTIME ,"spintime" }, - {} -}; - -static const struct trans_ctl_table trans_parport_device_table[] = { - {DEV_PARPORT_DEVICE_TIMESLICE ,"timeslice" }, - {} -}; - -static const struct trans_ctl_table trans_parport_devices_table[] = { - {DEV_PARPORT_DEVICES_ACTIVE ,"active" }, - {0 ,NULL , trans_parport_device_table }, - {} -}; - -static const struct trans_ctl_table trans_parport_parport_table[] = { - {DEV_PARPORT_SPINTIME ,"spintime" }, - {DEV_PARPORT_BASE_ADDR ,"base-addr" }, - {DEV_PARPORT_IRQ ,"irq" }, - {DEV_PARPORT_DMA ,"dma" }, - {DEV_PARPORT_MODES ,"modes" }, - {DEV_PARPORT_DEVICES ,"devices" , trans_parport_devices_table }, - {DEV_PARPORT_AUTOPROBE ,"autoprobe" }, - {DEV_PARPORT_AUTOPROBE +1 ,"autoprobe0" }, - {DEV_PARPORT_AUTOPROBE +2 ,"autoprobe1" }, - {DEV_PARPORT_AUTOPROBE +3 ,"autoprobe2" }, - {DEV_PARPORT_AUTOPROBE +4 ,"autoprobe3" }, - {} -}; -static const struct trans_ctl_table trans_parport_table[] = { - {DEV_PARPORT_DEFAULT ,"default" , trans_parport_default_table }, - {0 ,NULL , trans_parport_parport_table }, - {} -}; - -static const struct trans_ctl_table trans_dev_table[] = { - {DEV_CDROM ,"cdrom" , trans_cdrom_table }, -/* DEV_HWMON unused */ - {DEV_PARPORT ,"parport" , trans_parport_table }, - {DEV_RAID ,"raid" , trans_raid_table }, - {DEV_MAC_HID ,"mac_hid" , trans_mac_hid_files }, - {DEV_SCSI ,"scsi" , trans_scsi_table }, - {DEV_IPMI ,"ipmi" , trans_ipmi_table }, - {} -}; - -static const struct trans_ctl_table trans_bus_isa_table[] = { - {BUS_ISA_MEM_BASE ,"membase" }, - {BUS_ISA_PORT_BASE ,"portbase" }, - {BUS_ISA_PORT_SHIFT ,"portshift" }, - {} -}; - -static const struct trans_ctl_table trans_bus_table[] = { - {CTL_BUS_ISA ,"isa" , trans_bus_isa_table }, - {} -}; - -static const struct trans_ctl_table trans_arlan_conf_table0[] = { - {1 ,"spreadingCode" }, - {2 ,"channelNumber" }, - {3 ,"scramblingDisable" }, - {4 ,"txAttenuation" }, - {5 ,"systemId" }, - {6 ,"maxDatagramSize" }, - {7 ,"maxFrameSize" }, - {8 ,"maxRetries" }, - {9 ,"receiveMode" }, - {10 ,"priority" }, - {11 ,"rootOrRepeater" }, - {12 ,"SID" }, - {13 ,"registrationMode" }, - {14 ,"registrationFill" }, - {15 ,"localTalkAddress" }, - {16 ,"codeFormat" }, - {17 ,"numChannels" }, - {18 ,"channel1" }, - {19 ,"channel2" }, - {20 ,"channel3" }, - {21 ,"channel4" }, - {22 ,"txClear" }, - {23 ,"txRetries" }, - {24 ,"txRouting" }, - {25 ,"txScrambled" }, - {26 ,"rxParameter" }, - {27 ,"txTimeoutMs" }, - {28 ,"waitCardTimeout" }, - {29 ,"channelSet" }, - {30 ,"name" }, - {31 ,"waitTime" }, - {32 ,"lParameter" }, - {33 ,"_15" }, - {34 ,"headerSize" }, - {36 ,"tx_delay_ms" }, - {37 ,"retries" }, - {38 ,"ReTransmitPacketMaxSize" }, - {39 ,"waitReTransmitPacketMaxSize" }, - {40 ,"fastReTransCount" }, - {41 ,"driverRetransmissions" }, - {42 ,"txAckTimeoutMs" }, - {43 ,"registrationInterrupts" }, - {44 ,"hardwareType" }, - {45 ,"radioType" }, - {46 ,"writeEEPROM" }, - {47 ,"writeRadioType" }, - {48 ,"entry_exit_debug" }, - {49 ,"debug" }, - {50 ,"in_speed" }, - {51 ,"out_speed" }, - {52 ,"in_speed10" }, - {53 ,"out_speed10" }, - {54 ,"in_speed_max" }, - {55 ,"out_speed_max" }, - {56 ,"measure_rate" }, - {57 ,"pre_Command_Wait" }, - {58 ,"rx_tweak1" }, - {59 ,"rx_tweak2" }, - {60 ,"tx_queue_len" }, - - {150 ,"arlan0-txRing" }, - {151 ,"arlan0-rxRing" }, - {152 ,"arlan0-18" }, - {153 ,"arlan0-ring" }, - {154 ,"arlan0-shm-cpy" }, - {155 ,"config0" }, - {156 ,"reset0" }, - {} -}; - -static const struct trans_ctl_table trans_arlan_conf_table1[] = { - {1 ,"spreadingCode" }, - {2 ,"channelNumber" }, - {3 ,"scramblingDisable" }, - {4 ,"txAttenuation" }, - {5 ,"systemId" }, - {6 ,"maxDatagramSize" }, - {7 ,"maxFrameSize" }, - {8 ,"maxRetries" }, - {9 ,"receiveMode" }, - {10 ,"priority" }, - {11 ,"rootOrRepeater" }, - {12 ,"SID" }, - {13 ,"registrationMode" }, - {14 ,"registrationFill" }, - {15 ,"localTalkAddress" }, - {16 ,"codeFormat" }, - {17 ,"numChannels" }, - {18 ,"channel1" }, - {19 ,"channel2" }, - {20 ,"channel3" }, - {21 ,"channel4" }, - {22 ,"txClear" }, - {23 ,"txRetries" }, - {24 ,"txRouting" }, - {25 ,"txScrambled" }, - {26 ,"rxParameter" }, - {27 ,"txTimeoutMs" }, - {28 ,"waitCardTimeout" }, - {29 ,"channelSet" }, - {30 ,"name" }, - {31 ,"waitTime" }, - {32 ,"lParameter" }, - {33 ,"_15" }, - {34 ,"headerSize" }, - {36 ,"tx_delay_ms" }, - {37 ,"retries" }, - {38 ,"ReTransmitPacketMaxSize" }, - {39 ,"waitReTransmitPacketMaxSize" }, - {40 ,"fastReTransCount" }, - {41 ,"driverRetransmissions" }, - {42 ,"txAckTimeoutMs" }, - {43 ,"registrationInterrupts" }, - {44 ,"hardwareType" }, - {45 ,"radioType" }, - {46 ,"writeEEPROM" }, - {47 ,"writeRadioType" }, - {48 ,"entry_exit_debug" }, - {49 ,"debug" }, - {50 ,"in_speed" }, - {51 ,"out_speed" }, - {52 ,"in_speed10" }, - {53 ,"out_speed10" }, - {54 ,"in_speed_max" }, - {55 ,"out_speed_max" }, - {56 ,"measure_rate" }, - {57 ,"pre_Command_Wait" }, - {58 ,"rx_tweak1" }, - {59 ,"rx_tweak2" }, - {60 ,"tx_queue_len" }, - - {150 ,"arlan1-txRing" }, - {151 ,"arlan1-rxRing" }, - {152 ,"arlan1-18" }, - {153 ,"arlan1-ring" }, - {154 ,"arlan1-shm-cpy" }, - {155 ,"config1" }, - {156 ,"reset1" }, - {} -}; - -static const struct trans_ctl_table trans_arlan_conf_table2[] = { - {1 ,"spreadingCode" }, - {2 ,"channelNumber" }, - {3 ,"scramblingDisable" }, - {4 ,"txAttenuation" }, - {5 ,"systemId" }, - {6 ,"maxDatagramSize" }, - {7 ,"maxFrameSize" }, - {8 ,"maxRetries" }, - {9 ,"receiveMode" }, - {10 ,"priority" }, - {11 ,"rootOrRepeater" }, - {12 ,"SID" }, - {13 ,"registrationMode" }, - {14 ,"registrationFill" }, - {15 ,"localTalkAddress" }, - {16 ,"codeFormat" }, - {17 ,"numChannels" }, - {18 ,"channel1" }, - {19 ,"channel2" }, - {20 ,"channel3" }, - {21 ,"channel4" }, - {22 ,"txClear" }, - {23 ,"txRetries" }, - {24 ,"txRouting" }, - {25 ,"txScrambled" }, - {26 ,"rxParameter" }, - {27 ,"txTimeoutMs" }, - {28 ,"waitCardTimeout" }, - {29 ,"channelSet" }, - {30 ,"name" }, - {31 ,"waitTime" }, - {32 ,"lParameter" }, - {33 ,"_15" }, - {34 ,"headerSize" }, - {36 ,"tx_delay_ms" }, - {37 ,"retries" }, - {38 ,"ReTransmitPacketMaxSize" }, - {39 ,"waitReTransmitPacketMaxSize" }, - {40 ,"fastReTransCount" }, - {41 ,"driverRetransmissions" }, - {42 ,"txAckTimeoutMs" }, - {43 ,"registrationInterrupts" }, - {44 ,"hardwareType" }, - {45 ,"radioType" }, - {46 ,"writeEEPROM" }, - {47 ,"writeRadioType" }, - {48 ,"entry_exit_debug" }, - {49 ,"debug" }, - {50 ,"in_speed" }, - {51 ,"out_speed" }, - {52 ,"in_speed10" }, - {53 ,"out_speed10" }, - {54 ,"in_speed_max" }, - {55 ,"out_speed_max" }, - {56 ,"measure_rate" }, - {57 ,"pre_Command_Wait" }, - {58 ,"rx_tweak1" }, - {59 ,"rx_tweak2" }, - {60 ,"tx_queue_len" }, - - {150 ,"arlan2-txRing" }, - {151 ,"arlan2-rxRing" }, - {152 ,"arlan2-18" }, - {153 ,"arlan2-ring" }, - {154 ,"arlan2-shm-cpy" }, - {155 ,"config2" }, - {156 ,"reset2" }, - {} -}; - -static const struct trans_ctl_table trans_arlan_conf_table3[] = { - {1 ,"spreadingCode" }, - {2 ,"channelNumber" }, - {3 ,"scramblingDisable" }, - {4 ,"txAttenuation" }, - {5 ,"systemId" }, - {6 ,"maxDatagramSize" }, - {7 ,"maxFrameSize" }, - {8 ,"maxRetries" }, - {9 ,"receiveMode" }, - {10 ,"priority" }, - {11 ,"rootOrRepeater" }, - {12 ,"SID" }, - {13 ,"registrationMode" }, - {14 ,"registrationFill" }, - {15 ,"localTalkAddress" }, - {16 ,"codeFormat" }, - {17 ,"numChannels" }, - {18 ,"channel1" }, - {19 ,"channel2" }, - {20 ,"channel3" }, - {21 ,"channel4" }, - {22 ,"txClear" }, - {23 ,"txRetries" }, - {24 ,"txRouting" }, - {25 ,"txScrambled" }, - {26 ,"rxParameter" }, - {27 ,"txTimeoutMs" }, - {28 ,"waitCardTimeout" }, - {29 ,"channelSet" }, - {30 ,"name" }, - {31 ,"waitTime" }, - {32 ,"lParameter" }, - {33 ,"_15" }, - {34 ,"headerSize" }, - {36 ,"tx_delay_ms" }, - {37 ,"retries" }, - {38 ,"ReTransmitPacketMaxSize" }, - {39 ,"waitReTransmitPacketMaxSize" }, - {40 ,"fastReTransCount" }, - {41 ,"driverRetransmissions" }, - {42 ,"txAckTimeoutMs" }, - {43 ,"registrationInterrupts" }, - {44 ,"hardwareType" }, - {45 ,"radioType" }, - {46 ,"writeEEPROM" }, - {47 ,"writeRadioType" }, - {48 ,"entry_exit_debug" }, - {49 ,"debug" }, - {50 ,"in_speed" }, - {51 ,"out_speed" }, - {52 ,"in_speed10" }, - {53 ,"out_speed10" }, - {54 ,"in_speed_max" }, - {55 ,"out_speed_max" }, - {56 ,"measure_rate" }, - {57 ,"pre_Command_Wait" }, - {58 ,"rx_tweak1" }, - {59 ,"rx_tweak2" }, - {60 ,"tx_queue_len" }, - - {150 ,"arlan3-txRing" }, - {151 ,"arlan3-rxRing" }, - {152 ,"arlan3-18" }, - {153 ,"arlan3-ring" }, - {154 ,"arlan3-shm-cpy" }, - {155 ,"config3" }, - {156 ,"reset3" }, - {} -}; - -static const struct trans_ctl_table trans_arlan_table[] = { - {1 ,"arlan0" , trans_arlan_conf_table0 }, - {2 ,"arlan1" , trans_arlan_conf_table1 }, - {3 ,"arlan2" , trans_arlan_conf_table2 }, - {4 ,"arlan3" , trans_arlan_conf_table3 }, - {} -}; - -static const struct trans_ctl_table trans_s390dbf_table[] = { - {5678 /* CTL_S390DBF_STOPPABLE */ ,"debug_stoppable" }, - {5679 /* CTL_S390DBF_ACTIVE */ ,"debug_active" }, - {} -}; - -static const struct trans_ctl_table trans_sunrpc_table[] = { - {CTL_RPCDEBUG ,"rpc_debug" }, - {CTL_NFSDEBUG ,"nfs_debug" }, - {CTL_NFSDDEBUG ,"nfsd_debug" }, - {CTL_NLMDEBUG ,"nlm_debug" }, - {CTL_SLOTTABLE_UDP ,"udp_slot_table_entries" }, - {CTL_SLOTTABLE_TCP ,"tcp_slot_table_entries" }, - {CTL_MIN_RESVPORT ,"min_resvport" }, - {CTL_MAX_RESVPORT ,"max_resvport" }, - {} -}; - -static const struct trans_ctl_table trans_pm_table[] = { - {1 /* CTL_PM_SUSPEND */ ,"suspend" }, - {2 /* CTL_PM_CMODE */ ,"cmode" }, - {3 /* CTL_PM_P0 */ ,"p0" }, - {4 /* CTL_PM_CM */ ,"cm" }, - {} -}; - -static const struct trans_ctl_table trans_frv_table[] = { - {1 ,"cache-mode" }, - {2 ,"pin-cxnr" }, - {} -}; - -static const struct trans_ctl_table trans_root_table[] = { - {CTL_KERN ,"kernel" , trans_kern_table }, - {CTL_VM ,"vm" , trans_vm_table }, - {CTL_NET ,"net" , trans_net_table }, -/* CTL_PROC not used */ - {CTL_FS ,"fs" , trans_fs_table }, - {CTL_DEBUG ,"debug" , trans_debug_table }, - {CTL_DEV ,"dev" , trans_dev_table }, - {CTL_BUS ,"bus" , trans_bus_table }, - {CTL_ABI ,"abi" }, -/* CTL_CPU not used */ - {CTL_ARLAN ,"arlan" , trans_arlan_table }, - {CTL_S390DBF ,"s390dbf" , trans_s390dbf_table }, - {CTL_SUNRPC ,"sunrpc" , trans_sunrpc_table }, - {CTL_PM ,"pm" , trans_pm_table }, - {CTL_FRV ,"frv" , trans_frv_table }, - {} -}; - - -static int sysctl_depth (struct ctl_table *table) {
@@ -1261,47 +28,6 @@ static struct ctl_table *sysctl_parent(struct ctl_table *table, int n)return table; } -static const struct trans_ctl_table *sysctl_binary_lookup (struct ctl_table *table) -{ -struct ctl_table *test; -const struct trans_ctl_table *ref; -int cur_depth; - - cur_depth =sysctl_depth (table); - - ref = trans_root_table; -repeat: - test =sysctl_parent (table, cur_depth); -for (; ref->ctl_name || ref->procname || ref->child; ref++) { -int match =0 ; - -if (cur_depth && !ref->child) -continue ; - -if (test->procname && ref->procname && - (strcmp (test->procname, ref->procname) ==0 )) - match++; - -if (test->ctl_name && ref->ctl_name && - (test->ctl_name == ref->ctl_name)) - match++; - -if (!ref->ctl_name && !ref->procname) - match++; - -if (match) { -if (cur_depth !=0 ) { - cur_depth--; - ref = ref->child; - goto repeat; - } - goto out; - } - } - ref =NULL ; -out: -return ref; -}static void sysctl_print_path (struct ctl_table *table) {
@@ -1315,26 +41,6 @@ static void sysctl_print_path(struct ctl_table *table) } }printk (" " ); -if (table->ctl_name) { -for (i = depth; i >=0 ; i--) { - tmp =sysctl_parent (table, i); -printk (".%d" , tmp->ctl_name); - } - } -} - -static void sysctl_repair_table (struct ctl_table *table) -{ -/* Don't complain about the classic default -* sysctl strategy routine. Maybe later we -* can get the tables fixed and complain about -* this. -*/ -if (table->ctl_name && table->procname && - (table->proc_handler == proc_dointvec) && - (!table->strategy)) { - table->strategy = sysctl_data; - } } static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces,
@@ -1352,7 +58,7 @@ static struct ctl_table *sysctl_check_lookup(struct nsproxy *namespaces, ref = head->ctl_table; repeat: test =sysctl_parent (table, cur_depth); -for (; ref->ctl_name || ref->procname; ref++) { +for (; ref->procname; ref++) {int match =0 ;if (cur_depth && !ref->child)continue ;
@@ -1361,10 +67,6 @@ repeat: (strcmp(test->procname, ref->procname) == 0)) match++; -if (test->ctl_name && ref->ctl_name && - (test->ctl_name == ref->ctl_name)) - match++; -if (match) {if (cur_depth !=0 ) { cur_depth--;
@@ -1392,38 +94,6 @@ static void set_fail(const char **fail, struct ctl_table *table, const char *str *fail = str; } -static int sysctl_check_dir (struct nsproxy *namespaces, -struct ctl_table *table) -{ -struct ctl_table *ref; -int error; - - error =0 ; - ref =sysctl_check_lookup (namespaces, table); -if (ref) { -int match =0 ; -if ((!table->procname && !ref->procname) || - (table->procname && ref->procname && - (strcmp (table->procname, ref->procname) ==0 ))) - match++; - -if ((!table->ctl_name && !ref->ctl_name) || - (table->ctl_name && ref->ctl_name && - (table->ctl_name == ref->ctl_name))) - match++; - -if (match !=2 ) { -printk (KERN_ERR "%s: failed: " , __func__); -sysctl_print_path (table); -printk (" ref: " ); -sysctl_print_path (ref); -printk ("\n" ); - error = -EINVAL ; - } - } -return error; -} -static void sysctl_check_leaf (struct nsproxy *namespaces,struct ctl_table *table,const char **fail) {
@@ -1434,37 +104,15 @@ static void sysctl_check_leaf(struct nsproxy *namespaces,set_fail (fail, table,"Sysctl already exists" ); } -static void sysctl_check_bin_path (struct ctl_table *table,const char **fail) -{ -const struct trans_ctl_table *ref; - - ref =sysctl_binary_lookup (table); -if (table->ctl_name && !ref) -set_fail (fail, table,"Unknown sysctl binary path" ); -if (ref) { -if (ref->procname && - (!table->procname || - (strcmp (table->procname, ref->procname) !=0 ))) -set_fail (fail, table,"procname does not match binary path procname" ); - -if (ref->ctl_name && table->ctl_name && - (table->ctl_name != ref->ctl_name)) -set_fail (fail, table,"ctl_name does not match binary path ctl_name" ); - } -} -int sysctl_check_table (struct nsproxy *namespaces,struct ctl_table *table) {int error =0 ; -for (; table->ctl_name || table->procname; table++) { +for (; table->procname; table++) {const char *fail =NULL ; -sysctl_repair_table (table);if (table->parent) {if (table->procname && !table->parent->procname)set_fail (&fail, table,"Parent without procname" ); -if (table->ctl_name && !table->parent->ctl_name) -set_fail (&fail, table,"Parent without ctl_name" ); }if (!table->procname)set_fail (&fail, table,"No procname" );
@@ -1477,21 +125,12 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)set_fail (&fail, table,"Writable sysctl directory" );if (table->proc_handler)set_fail (&fail, table,"Directory with proc_handler" ); -if (table->strategy) -set_fail (&fail, table,"Directory with strategy" );if (table->extra1)set_fail (&fail, table,"Directory with extra1" );if (table->extra2)set_fail (&fail, table,"Directory with extra2" ); -if (sysctl_check_dir (namespaces, table)) -set_fail (&fail, table,"Inconsistent directory names" ); }else { - if ((table->strategy == sysctl_data) || - (table->strategy == sysctl_string) || - (table->strategy == sysctl_intvec) || - (table->strategy == sysctl_jiffies) || - (table->strategy == sysctl_ms_jiffies) || - (table->proc_handler == proc_dostring) || + if ((table->proc_handler == proc_dostring) || (table->proc_handler == proc_dointvec) || (table->proc_handler == proc_dointvec_minmax) || (table->proc_handler == proc_dointvec_jiffies) ||
@@ -1513,14 +152,6 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)set_fail (&fail, table,"No max" ); } } -#ifdef CONFIG_SYSCTL_SYSCALL -if (table->ctl_name && !table->strategy) -set_fail (&fail, table,"Missing strategy" ); -#endif -#if 0 -if (!table->ctl_name && table->strategy) -set_fail (&fail, table,"Strategy without ctl_name" ); -#endif #ifdef CONFIG_PROC_SYSCTL if (table->procname && !table->proc_handler)set_fail (&fail, table,"No proc_handler" );
@@ -1531,7 +162,6 @@ int sysctl_check_table(struct nsproxy *namespaces, struct ctl_table *table)#endif sysctl_check_leaf (namespaces, table, &fail); } -sysctl_check_bin_path (table, &fail);if (table->mode >0777 )set_fail (&fail, table,"bogus .mode" );if (fail) {
lib/Kconfig.debug +1 -1
@@ -912,7 +912,7 @@ config LATENCYTOP config SYSCTL_SYSCALL_CHECK bool "Sysctl checks" - depends on SYSCTL_SYSCALL + depends on SYSCTL ---help--- sys_sysctl uses binary paths that have been found challenging to properly maintain and use. This enables checks that help
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 8/23 sysctl ipc: Remove dead binary sysctl support code.
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
--- ipc/ipc_sysctl.c | 77 ------------------------------------------------------ ipc/mq_sysctl.c | 7 ++--- 2 files changed, 3 insertions(+), 81 deletions(-)
ipc/ipc_sysctl.c +0 -77
@@ -129,136 +129,60 @@ static int proc_ipcauto_dointvec_minmax(ctl_table *table, int write,#define proc_ipcauto_dointvec_minmax NULL#endif -#ifdef CONFIG_SYSCTL_SYSCALL -/* The generic sysctl ipc data routine. */ -static int sysctl_ipc_data (ctl_table *table, -void __user *oldval,size_t __user *oldlenp, -void __user *newval,size_t newlen) -{ -size_t len; -void *data; - -/* Get out of I don't have a variable */ -if (!table->data || !table->maxlen) -return -ENOTDIR ; - - data =get_ipc (table); -if (!data) -return -ENOTDIR ; - -if (oldval && oldlenp) { -if (get_user (len, oldlenp)) -return -EFAULT ; -if (len) { -if (len > table->maxlen) - len = table->maxlen; -if (copy_to_user (oldval, data, len)) -return -EFAULT ; -if (put_user (len, oldlenp)) -return -EFAULT ; - } - } - -if (newval && newlen) { -if (newlen > table->maxlen) - newlen = table->maxlen; - -if (copy_from_user (data, newval, newlen)) -return -EFAULT ; - } -return 1 ; -} - -static int sysctl_ipc_registered_data (ctl_table *table, -void __user *oldval,size_t __user *oldlenp, -void __user *newval,size_t newlen) -{ -int rc; - - rc =sysctl_ipc_data (table, oldval, oldlenp, newval, newlen); - -if (newval && newlen && rc >0 ) -/* -* Tunable has successfully been changed from userland -*/ -unregister_ipcns_notifier (current->nsproxy->ipc_ns); - -return rc; -} -#else -#define sysctl_ipc_data NULL -#define sysctl_ipc_registered_data NULL -#endif -static int zero;static int one =1 ;static struct ctl_table ipc_kern_table[] = { { - .ctl_name =KERN_SHMMAX , .procname ="shmmax" , .data = &init_ipc_ns.shm_ctlmax, .maxlen =sizeof (init_ipc_ns.shm_ctlmax), .mode =0644 , .proc_handler = proc_ipc_doulongvec_minmax, - .strategy = sysctl_ipc_data, }, { - .ctl_name =KERN_SHMALL , .procname ="shmall" , .data = &init_ipc_ns.shm_ctlall, .maxlen =sizeof (init_ipc_ns.shm_ctlall), .mode =0644 , .proc_handler = proc_ipc_doulongvec_minmax, - .strategy = sysctl_ipc_data, }, { - .ctl_name =KERN_SHMMNI , .procname ="shmmni" , .data = &init_ipc_ns.shm_ctlmni, .maxlen =sizeof (init_ipc_ns.shm_ctlmni), .mode =0644 , .proc_handler = proc_ipc_dointvec, - .strategy = sysctl_ipc_data, }, { - .ctl_name =KERN_MSGMAX , .procname ="msgmax" , .data = &init_ipc_ns.msg_ctlmax, .maxlen =sizeof (init_ipc_ns.msg_ctlmax), .mode =0644 , .proc_handler = proc_ipc_dointvec, - .strategy = sysctl_ipc_data, }, { - .ctl_name =KERN_MSGMNI , .procname ="msgmni" , .data = &init_ipc_ns.msg_ctlmni, .maxlen =sizeof (init_ipc_ns.msg_ctlmni), .mode =0644 , .proc_handler = proc_ipc_callback_dointvec, - .strategy = sysctl_ipc_registered_data, }, { - .ctl_name =KERN_MSGMNB , .procname ="msgmnb" , .data = &init_ipc_ns.msg_ctlmnb, .maxlen =sizeof (init_ipc_ns.msg_ctlmnb), .mode =0644 , .proc_handler = proc_ipc_dointvec, - .strategy = sysctl_ipc_data, }, { - .ctl_name =KERN_SEM , .procname ="sem" , .data = &init_ipc_ns.sem_ctls, .maxlen =4 *sizeof (int ), .mode =0644 , .proc_handler = proc_ipc_dointvec, - .strategy = sysctl_ipc_data, }, { - .ctl_name =CTL_UNNUMBERED , .procname ="auto_msgmni" , .data = &init_ipc_ns.auto_msgmni, .maxlen =sizeof (int ),
@@ -272,7 +196,6 @@ static struct ctl_table ipc_kern_table[] = {static struct ctl_table ipc_root_table[] = { { - .ctl_name =CTL_KERN , .procname ="kernel" , .mode =0555 , .child = ipc_kern_table,
ipc/mq_sysctl.c +3 -4
@@ -88,7 +88,7 @@ static ctl_table mq_sysctls[] = { .extra1 = &msg_maxsize_limit_min, .extra2 = &msg_maxsize_limit_max, }, - { .ctl_name = 0 } + {} }; static ctl_table mq_sysctl_dir[] = {
@@ -97,17 +97,16 @@ static ctl_table mq_sysctl_dir[] = { .mode = 0555, .child = mq_sysctls, }, - { .ctl_name = 0 } + {} };static ctl_table mq_sysctl_root[] = { { - .ctl_name =CTL_FS , .procname ="fs" , .mode =0555 , .child = mq_sysctl_dir, }, - { .ctl_name =0 } + {} };struct ctl_table_header *mq_register_sysctl_table (void )
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 10/23 sysctl fs: Remove dead binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
--- fs/coda/sysctl.c | 4 ---- fs/eventpoll.c | 2 +- fs/lockd/svc.c | 14 +++----------- fs/nfs/sysctl.c | 14 +++----------- fs/notify/inotify/inotify_user.c | 8 +------- fs/ntfs/sysctl.c | 2 -- fs/ocfs2/stackglue.c | 13 ++++--------- fs/quota/dquot.c | 17 +++-------------- fs/xfs/linux-2.6/xfs_sysctl.c | 32 -------------------------------- 9 files changed, 15 insertions(+), 91 deletions(-)
fs/coda/sysctl.c +0 -4
@@ -17,7 +17,6 @@ static struct ctl_table_header *fs_table_header;static ctl_table coda_table[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="timeout" , .data = &coda_timeout, .maxlen =sizeof (int ),
@@ -25,7 +24,6 @@ static ctl_table coda_table[] = { .proc_handler = &proc_dointvec }, { - .ctl_name = CTL_UNNUMBERED, .procname = "hard", .data = &coda_hard, .maxlen = sizeof(int),
@@ -33,7 +31,6 @@ static ctl_table coda_table[] = { .proc_handler = &proc_dointvec }, { - .ctl_name = CTL_UNNUMBERED, .procname = "fake_statfs", .data = &coda_fake_statfs, .maxlen = sizeof(int),
@@ -46,7 +43,6 @@ static ctl_table coda_table[] = { #ifdef CONFIG_SYSCTL static ctl_table fs_table[] = { { - .ctl_name = CTL_UNNUMBERED, .procname = "coda", .mode = 0555, .child = coda_table
fs/eventpoll.c +1 -1
@@ -254,7 +254,7 @@ ctl_table epoll_table[] = { .proc_handler = &proc_dointvec_minmax, .extra1 = &zero, }, - { .ctl_name = 0 } + { } };#endif /* CONFIG_SYSCTL */
fs/lockd/svc.c +3 -11
@@ -371,7 +371,6 @@ EXPORT_SYMBOL_GPL(lockd_down);static ctl_table nlm_sysctls[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="nlm_grace_period" , .data = &nlm_grace_period, .maxlen =sizeof (unsigned long ),
@@ -381,7 +380,6 @@ static ctl_table nlm_sysctls[] = { .extra2 = (unsigned long *) &nlm_grace_period_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "nlm_timeout", .data = &nlm_timeout, .maxlen = sizeof(unsigned long),
@@ -391,7 +389,6 @@ static ctl_table nlm_sysctls[] = { .extra2 = (unsigned long *) &nlm_timeout_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "nlm_udpport", .data = &nlm_udpport, .maxlen = sizeof(int),
@@ -401,7 +398,6 @@ static ctl_table nlm_sysctls[] = { .extra2 = (int *) &nlm_port_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "nlm_tcpport", .data = &nlm_tcpport, .maxlen = sizeof(int),
@@ -411,7 +407,6 @@ static ctl_table nlm_sysctls[] = { .extra2 = (int *) &nlm_port_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "nsm_use_hostnames", .data = &nsm_use_hostnames, .maxlen = sizeof(int),
@@ -419,34 +414,31 @@ static ctl_table nlm_sysctls[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "nsm_local_state", .data = &nsm_local_state, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec, }, - { .ctl_name = 0 } + { } };static ctl_table nlm_sysctl_dir[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="nfs" , .mode =0555 , .child = nlm_sysctls, }, - { .ctl_name =0 } + { } };static ctl_table nlm_sysctl_root[] = { { - .ctl_name =CTL_FS , .procname ="fs" , .mode =0555 , .child = nlm_sysctl_dir, }, - { .ctl_name =0 } + { } };#endif /* CONFIG_SYSCTL */
fs/nfs/sysctl.c +3 -11
@@ -22,7 +22,6 @@ static struct ctl_table_header *nfs_callback_sysctl_table; static ctl_table nfs_cb_sysctls[] = { #ifdef CONFIG_NFS_V4 { - .ctl_name = CTL_UNNUMBERED, .procname = "nfs_callback_tcpport", .data = &nfs_callback_set_tcpport, .maxlen = sizeof(int),
@@ -32,53 +31,46 @@ static ctl_table nfs_cb_sysctls[] = { .extra2 = (int *)&nfs_set_port_max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "idmap_cache_timeout", .data = &nfs_idmap_cache_timeout, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_jiffies, - .strategy = &sysctl_jiffies, },#endif { - .ctl_name = CTL_UNNUMBERED, .procname = "nfs_mountpoint_timeout", .data = &nfs_mountpoint_expiry_timeout, .maxlen = sizeof(nfs_mountpoint_expiry_timeout), .mode = 0644, .proc_handler = &proc_dointvec_jiffies, - .strategy = &sysctl_jiffies, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "nfs_congestion_kb", .data = &nfs_congestion_kb, .maxlen = sizeof(nfs_congestion_kb), .mode = 0644, .proc_handler = &proc_dointvec, }, - { .ctl_name = 0 } + { } };static ctl_table nfs_cb_sysctl_dir[] = { { - .ctl_name = CTL_UNNUMBERED, .procname ="nfs" , .mode =0555 , .child = nfs_cb_sysctls, }, - { .ctl_name = 0 } + { } };static ctl_table nfs_cb_sysctl_root[] = { { - .ctl_name = CTL_FS, .procname ="fs" , .mode =0555 , .child = nfs_cb_sysctl_dir, }, - { .ctl_name = 0 } + { } };int nfs_register_sysctl (void )
fs/notify/inotify/inotify_user.c +1 -7
@@ -69,36 +69,30 @@ static int zero;ctl_table inotify_table[] = { { - .ctl_name =INOTIFY_MAX_USER_INSTANCES , .procname ="max_user_instances" , .data = &inotify_max_user_instances, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, }, { - .ctl_name =INOTIFY_MAX_USER_WATCHES , .procname ="max_user_watches" , .data = &inotify_max_user_watches, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, }, { - .ctl_name =INOTIFY_MAX_QUEUED_EVENTS , .procname ="max_queued_events" , .data = &inotify_max_queued_events, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero }, - { .ctl_name =0 } + { } };#endif /* CONFIG_SYSCTL */
fs/ntfs/sysctl.c +0 -2
@@ -36,7 +36,6 @@/* Definition of the ntfs sysctl. */ static ctl_table ntfs_sysctls[] = { { - .ctl_name =CTL_UNNUMBERED ,/* Binary and text IDs. */ .procname ="ntfs-debug" , .data = &debug_msgs,/* Data pointer and size. */ .maxlen =sizeof (debug_msgs),
@@ -49,7 +48,6 @@ static ctl_table ntfs_sysctls[] = {/* Define the parent directory /proc/sys/fs. */ static ctl_table sysctls_root[] = { { - .ctl_name =CTL_FS , .procname ="fs" , .mode =0555 , .child = ntfs_sysctls
fs/ocfs2/stackglue.c +4 -9
@@ -620,51 +620,46 @@ error:static ctl_table ocfs2_nm_table[] = { { - .ctl_name =1 , .procname ="hb_ctl_path" , .data = ocfs2_hb_ctl_path, .maxlen =OCFS2_MAX_HB_CTL_PATH , .mode =0644 , .proc_handler = &proc_dostring, - .strategy = &sysctl_string, }, - { .ctl_name =0 } + { } };static ctl_table ocfs2_mod_table[] = { { - .ctl_name =FS_OCFS2_NM , .procname ="nm" , .data =NULL , .maxlen =0 , .mode =0555 , .child = ocfs2_nm_table }, - { .ctl_name =0 } + { } };static ctl_table ocfs2_kern_table[] = { { - .ctl_name =FS_OCFS2 , .procname ="ocfs2" , .data =NULL , .maxlen =0 , .mode =0555 , .child = ocfs2_mod_table }, - { .ctl_name =0 } + { } };static ctl_table ocfs2_root_table[] = { { - .ctl_name =CTL_FS , .procname ="fs" , .data =NULL , .maxlen =0 , .mode =0555 , .child = ocfs2_kern_table }, - { .ctl_name =0 } + { } };static struct ctl_table_header *ocfs2_table_header =NULL ;
fs/quota/dquot.c +3 -14
@@ -2473,7 +2473,6 @@ const struct quotactl_ops vfs_quotactl_ops = {static ctl_table fs_dqstats_table[] = { { - .ctl_name =FS_DQ_LOOKUPS , .procname ="lookups" , .data = &dqstats.lookups, .maxlen =sizeof (int ),
@@ -2481,7 +2480,6 @@ static ctl_table fs_dqstats_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = FS_DQ_DROPS, .procname = "drops", .data = &dqstats.drops, .maxlen = sizeof(int),
@@ -2489,7 +2487,6 @@ static ctl_table fs_dqstats_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = FS_DQ_READS, .procname = "reads", .data = &dqstats.reads, .maxlen = sizeof(int),
@@ -2497,7 +2494,6 @@ static ctl_table fs_dqstats_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = FS_DQ_WRITES, .procname = "writes", .data = &dqstats.writes, .maxlen = sizeof(int),
@@ -2505,7 +2501,6 @@ static ctl_table fs_dqstats_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = FS_DQ_CACHE_HITS, .procname = "cache_hits", .data = &dqstats.cache_hits, .maxlen = sizeof(int),
@@ -2513,7 +2508,6 @@ static ctl_table fs_dqstats_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = FS_DQ_ALLOCATED, .procname = "allocated_dquots", .data = &dqstats.allocated_dquots, .maxlen = sizeof(int),
@@ -2521,7 +2515,6 @@ static ctl_table fs_dqstats_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = FS_DQ_FREE, .procname = "free_dquots", .data = &dqstats.free_dquots, .maxlen = sizeof(int),
@@ -2529,7 +2522,6 @@ static ctl_table fs_dqstats_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = FS_DQ_SYNCS, .procname = "syncs", .data = &dqstats.syncs, .maxlen = sizeof(int),
@@ -2538,7 +2530,6 @@ static ctl_table fs_dqstats_table[] = { },#ifdef CONFIG_PRINT_QUOTA_WARNING { - .ctl_name = FS_DQ_WARNINGS, .procname = "warnings", .data = &flag_print_warnings, .maxlen = sizeof(int),
@@ -2546,27 +2537,25 @@ static ctl_table fs_dqstats_table[] = { .proc_handler = &proc_dointvec, },#endif - { .ctl_name = 0 }, + { }, };static ctl_table fs_table[] = { { - .ctl_name =FS_DQSTATS , .procname ="quota" , .mode =0555 , .child = fs_dqstats_table, }, - { .ctl_name =0 }, + { }, };static ctl_table sys_table[] = { { - .ctl_name =CTL_FS , .procname ="fs" , .mode =0555 , .child = fs_table, }, - { .ctl_name =0 }, + { }, };static int __init dquot_init (void )
fs/xfs/linux-2.6/xfs_sysctl.c +0 -32
@@ -55,170 +55,140 @@ xfs_stats_clear_proc_handler(static ctl_table xfs_table[] = { { - .ctl_name =XFS_SGID_INHERIT , .procname ="irix_sgid_inherit" , .data = &xfs_params.sgid_inherit.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.sgid_inherit.min, .extra2 = &xfs_params.sgid_inherit.max }, { - .ctl_name =XFS_SYMLINK_MODE , .procname ="irix_symlink_mode" , .data = &xfs_params.symlink_mode.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.symlink_mode.min, .extra2 = &xfs_params.symlink_mode.max }, { - .ctl_name =XFS_PANIC_MASK , .procname ="panic_mask" , .data = &xfs_params.panic_mask.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.panic_mask.min, .extra2 = &xfs_params.panic_mask.max }, { - .ctl_name =XFS_ERRLEVEL , .procname ="error_level" , .data = &xfs_params.error_level.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.error_level.min, .extra2 = &xfs_params.error_level.max }, { - .ctl_name =XFS_SYNCD_TIMER , .procname ="xfssyncd_centisecs" , .data = &xfs_params.syncd_timer.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.syncd_timer.min, .extra2 = &xfs_params.syncd_timer.max }, { - .ctl_name =XFS_INHERIT_SYNC , .procname ="inherit_sync" , .data = &xfs_params.inherit_sync.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.inherit_sync.min, .extra2 = &xfs_params.inherit_sync.max }, { - .ctl_name =XFS_INHERIT_NODUMP , .procname ="inherit_nodump" , .data = &xfs_params.inherit_nodump.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.inherit_nodump.min, .extra2 = &xfs_params.inherit_nodump.max }, { - .ctl_name =XFS_INHERIT_NOATIME , .procname ="inherit_noatime" , .data = &xfs_params.inherit_noatim.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.inherit_noatim.min, .extra2 = &xfs_params.inherit_noatim.max }, { - .ctl_name =XFS_BUF_TIMER , .procname ="xfsbufd_centisecs" , .data = &xfs_params.xfs_buf_timer.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.xfs_buf_timer.min, .extra2 = &xfs_params.xfs_buf_timer.max }, { - .ctl_name =XFS_BUF_AGE , .procname ="age_buffer_centisecs" , .data = &xfs_params.xfs_buf_age.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.xfs_buf_age.min, .extra2 = &xfs_params.xfs_buf_age.max }, { - .ctl_name =XFS_INHERIT_NOSYM , .procname ="inherit_nosymlinks" , .data = &xfs_params.inherit_nosym.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.inherit_nosym.min, .extra2 = &xfs_params.inherit_nosym.max }, { - .ctl_name =XFS_ROTORSTEP , .procname ="rotorstep" , .data = &xfs_params.rotorstep.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.rotorstep.min, .extra2 = &xfs_params.rotorstep.max }, { - .ctl_name =XFS_INHERIT_NODFRG , .procname ="inherit_nodefrag" , .data = &xfs_params.inherit_nodfrg.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.inherit_nodfrg.min, .extra2 = &xfs_params.inherit_nodfrg.max }, { - .ctl_name =XFS_FILESTREAM_TIMER , .procname ="filestream_centisecs" , .data = &xfs_params.fstrm_timer.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.fstrm_timer.min, .extra2 = &xfs_params.fstrm_timer.max, },/* please keep this the last entry */ #ifdef CONFIG_PROC_FS { - .ctl_name =XFS_STATS_CLEAR , .procname ="stats_clear" , .data = &xfs_params.stats_clear.val, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &xfs_stats_clear_proc_handler, - .strategy = &sysctl_intvec, .extra1 = &xfs_params.stats_clear.min, .extra2 = &xfs_params.stats_clear.max },
@@ -229,7 +199,6 @@ static ctl_table xfs_table[] = {static ctl_table xfs_dir_table[] = { { - .ctl_name =FS_XFS , .procname ="xfs" , .mode =0555 , .child = xfs_table
@@ -239,7 +208,6 @@ static ctl_table xfs_dir_table[] = {static ctl_table xfs_root_table[] = { { - .ctl_name =CTL_FS , .procname ="fs" , .mode =0555 , .child = xfs_dir_table
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 13/23 sysctl crypto: Remove dead binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
--- crypto/proc.c | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-)
crypto/proc.c +2 -8
@@ -25,28 +25,22 @@#ifdef CONFIG_CRYPTO_FIPS static struct ctl_table crypto_sysctl_table[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="fips_enabled" , .data = &fips_enabled, .maxlen =sizeof (int ), .mode =0444 , .proc_handler = &proc_dointvec }, - { - .ctl_name =0 , - }, + {} };static struct ctl_table crypto_dir_table[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="crypto" , .mode =0555 , .child = crypto_sysctl_table }, - { - .ctl_name =0 , - }, + {} };static struct ctl_table_header *crypto_sysctls;
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 17/23 sysctl s390: Remove dead sysctl binary support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
--- arch/s390/kernel/debug.c | 9 ++------- arch/s390/mm/cmm.c | 5 ++--- drivers/s390/char/sclp_async.c | 5 ++--- 3 files changed, 6 insertions(+), 13 deletions(-)
arch/s390/kernel/debug.c +2 -7
@@ -893,35 +893,30 @@ s390dbf_procactive(ctl_table *table, int write,static struct ctl_table s390dbf_table[] = { { - .ctl_name =CTL_S390DBF_STOPPABLE , .procname ="debug_stoppable" , .data = &debug_stoppable, .maxlen =sizeof (int ), .mode =S_IRUGO |S_IWUSR , .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec, }, { - .ctl_name =CTL_S390DBF_ACTIVE , .procname ="debug_active" , .data = &debug_active, .maxlen =sizeof (int ), .mode =S_IRUGO |S_IWUSR , .proc_handler = &s390dbf_procactive, - .strategy = &sysctl_intvec, }, - { .ctl_name =0 } + { } };static struct ctl_table s390dbf_dir_table[] = { { - .ctl_name =CTL_S390DBF , .procname ="s390dbf" , .maxlen =0 , .mode =S_IRUGO |S_IXUGO , .child = s390dbf_table, }, - { .ctl_name =0 } + { } };static struct ctl_table_header *s390dbf_sysctl_header;
arch/s390/mm/cmm.c +2 -3
@@ -355,18 +355,17 @@ static struct ctl_table cmm_table[] = { .mode = 0644, .proc_handler = &cmm_timeout_handler, }, - { .ctl_name = 0 } + { } };static struct ctl_table cmm_dir_table[] = { { - .ctl_name =CTL_VM , .procname ="vm" , .maxlen =0 , .mode =0555 , .child = cmm_table, }, - { .ctl_name =0 } + { } };#endif
drivers/s390/char/sclp_async.c +2 -3
@@ -101,18 +101,17 @@ static struct ctl_table callhome_table[] = { .mode = 0644, .proc_handler = proc_handler_callhome, }, - { .ctl_name = 0 } + {} };static struct ctl_table kern_dir_table[] = { { - .ctl_name =CTL_KERN , .procname ="kernel" , .maxlen =0 , .mode =0555 , .child = callhome_table, }, - { .ctl_name =0 } + {} };/*
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 23/23 sysctl: Remove the last of the generic binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that all of the users stopped using ctl_name and strategy it is safe to remove the fields from struct ctl_table, and it is safe to remove the stub strategy routines as well.
--- include/linux/sysctl.h | 3 --- kernel/sysctl.c | 44 -------------------------------------------- 2 files changed, 0 insertions(+), 47 deletions(-)
include/linux/sysctl.h +0 -3
@@ -1033,7 +1033,6 @@ extern ctl_handler sysctl_ms_jiffies;/* A sysctl table is an array of struct ctl_table: */ struct ctl_table { -int ctl_name;/* Binary ID */ const char *procname;/* Text ID for /proc/sys, or zero */ void *data;int maxlen;
@@ -1041,7 +1040,6 @@ struct ctl_tablestruct ctl_table *child;struct ctl_table *parent;/* Automatically set */ proc_handler *proc_handler;/* Callback for text formatting */ -ctl_handler *strategy;/* Callback function for all r/w */ void *extra1;void *extra2; };
@@ -1075,7 +1073,6 @@ struct ctl_table_header/* struct ctl_path describes where in the hierarchy a table is added */ struct ctl_path {const char *procname; -int ctl_name; };void register_sysctl_root (struct ctl_table_root *root);
kernel/sysctl.c +0 -44
66 lines not on this page · raw message
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 22/23 sysctl arm: Remove binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Remove a smattering of ctl_names used in sysctl paths, and kill the ctl_names in the recently added mach-bcmring.
mach-bcmring never should have had sysctl entries with .ctl_name set. The binary sysctl interface has been frozen for a long time before that code was merged, to prevent
probmes with conflicts and lack of testing. The sysctl_check
code would have caught this if anyone had ever tested it that way. So I have simply dropped the binary sysctl support instead of adding another compat entry into sysctl_binary.c. Going through /proc/sys/reboot/warm will still work.
--- arch/arm/kernel/isa.c | 11 +++-------- arch/arm/mach-bcmring/arch.c | 6 ------ 2 files changed, 3 insertions(+), 14 deletions(-)
arch/arm/kernel/isa.c +3 -8
@@ -22,47 +22,42 @@ static unsigned int isa_membase, isa_portbase, isa_portshift;static ctl_table ctl_isa_vars[4 ] = { { - .ctl_name =BUS_ISA_MEM_BASE , .procname ="membase" , .data = &isa_membase, .maxlen =sizeof (isa_membase), .mode =0444 , .proc_handler = &proc_dointvec, }, { - .ctl_name =BUS_ISA_PORT_BASE , .procname ="portbase" , .data = &isa_portbase, .maxlen =sizeof (isa_portbase), .mode =0444 , .proc_handler = &proc_dointvec, }, { - .ctl_name =BUS_ISA_PORT_SHIFT , .procname ="portshift" , .data = &isa_portshift, .maxlen =sizeof (isa_portshift), .mode =0444 , .proc_handler = &proc_dointvec, - }, {0 } + }, {} };static struct ctl_table_header *isa_sysctl_header;static ctl_table ctl_isa[2 ] = { { - .ctl_name =CTL_BUS_ISA , .procname ="isa" , .mode =0555 , .child = ctl_isa_vars, - }, {0 } + }, {} };static ctl_table ctl_bus[2 ] = { { - .ctl_name =CTL_BUS , .procname ="bus" , .mode =0555 , .child = ctl_isa, - }, {0 } + }, {} };void __init
arch/arm/mach-bcmring/arch.c +0 -6
@@ -47,10 +47,6 @@ HW_DECLARE_SPINLOCK(gpio)EXPORT_SYMBOL (bcmring_gpio_reg_lock);#endif -/* FIXME: temporary solution */ -#define BCM_SYSCTL_REBOOT_WARM 1 -#define CTL_BCM_REBOOT 112 -/* sysctl */ int bcmring_arch_warm_reboot;/* do a warm reboot on hard reset */
@@ -58,7 +54,6 @@ static struct ctl_table_header *bcmring_sysctl_header;static struct ctl_table bcmring_sysctl_warm_reboot[] = { { - .ctl_name =BCM_SYSCTL_REBOOT_WARM , .procname ="warm" , .data = &bcmring_arch_warm_reboot, .maxlen =sizeof (int ),
@@ -69,7 +64,6 @@ static struct ctl_table bcmring_sysctl_warm_reboot[] = {static struct ctl_table bcmring_sysctl_reboot[] = { { - .ctl_name =CTL_BCM_REBOOT , .procname ="reboot" , .mode =0555 , .child = bcmring_sysctl_warm_reboot},
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 21/23 sysctl x86: Remove dead binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
--- arch/x86/kernel/vsyscall_64.c | 2 +- arch/x86/vdso/vdso32-setup.c | 1 - 2 files changed, 1 insertions(+), 2 deletions(-)
arch/x86/kernel/vsyscall_64.c +1 -1
@@ -237,7 +237,7 @@ static ctl_table kernel_table2[] = { };static ctl_table kernel_root_table2[] = { - { .ctl_name =CTL_KERN , .procname ="kernel" , .mode =0555 , + { .procname ="kernel" , .mode =0555 , .child = kernel_table2 }, {} };
arch/x86/vdso/vdso32-setup.c +0 -1
@@ -393,7 +393,6 @@ static ctl_table abi_table2[] = {static ctl_table abi_root_table2[] = { { - .ctl_name =CTL_ABI , .procname ="abi" , .mode =0555 , .child = abi_table2
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 19/23 sysctl powerpc: Remove dead binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
--- arch/powerpc/kernel/idle.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
arch/powerpc/kernel/idle.c +0 -2
@@ -110,7 +110,6 @@ int powersave_nap;*/ static ctl_table powersave_nap_ctl_table[]={ { - .ctl_name =KERN_PPC_POWERSAVE_NAP , .procname ="powersave-nap" , .data = &powersave_nap, .maxlen =sizeof (int ),
@@ -121,7 +120,6 @@ static ctl_table powersave_nap_ctl_table[]={ };static ctl_table powersave_nap_sysctl_root[] = { { - .ctl_name =CTL_KERN , .procname ="kernel" , .mode =0555 , .child = powersave_nap_ctl_table,
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 20/23 sysctl sh: Remove dead binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
Also add an C99 named initializer to the child member of unaligned_root to prevent chaos as the ctl_table definition changes over time.
--- arch/sh/kernel/traps_64.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
arch/sh/kernel/traps_64.c +1 -6
@@ -877,7 +877,6 @@ static int misaligned_fixup(struct pt_regs *regs)static ctl_table unaligned_table[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="kernel_reports" , .data = &kernel_mode_unaligned_fixup_count, .maxlen =sizeof (int ),
@@ -885,7 +884,6 @@ static ctl_table unaligned_table[] = { .proc_handler = &proc_dointvec }, { - .ctl_name = CTL_UNNUMBERED, .procname = "user_reports", .data = &user_mode_unaligned_fixup_count, .maxlen = sizeof(int),
@@ -893,7 +891,6 @@ static ctl_table unaligned_table[] = { .proc_handler = &proc_dointvec }, { - .ctl_name = CTL_UNNUMBERED, .procname = "user_enable", .data = &user_mode_unaligned_fixup_enable, .maxlen = sizeof(int),
@@ -904,17 +901,15 @@ static ctl_table unaligned_table[] = {static ctl_table unaligned_root[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="unaligned_fixup" , .mode =0555 , - unaligned_table + .child = unaligned_table }, {} };static ctl_table sh64_root[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="sh64" , .mode =0555 , .child = unaligned_root
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 18/23 sysctl ia64: Remove dead binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
--- arch/ia64/kernel/crash.c | 7 ++----- arch/ia64/kernel/perfmon.c | 6 ------ drivers/misc/sgi-xp/xpc_main.c | 8 -------- 3 files changed, 2 insertions(+), 19 deletions(-)
arch/ia64/kernel/crash.c +2 -5
@@ -239,7 +239,6 @@ kdump_init_notifier(struct notifier_block *self, unsigned long val, void *data) #ifdef CONFIG_SYSCTL static ctl_table kdump_ctl_table[] = { { - .ctl_name = CTL_UNNUMBERED, .procname = "kdump_on_init", .data = &kdump_on_init, .maxlen = sizeof(int),
@@ -247,24 +246,22 @@ static ctl_table kdump_ctl_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "kdump_on_fatal_mca", .data = &kdump_on_fatal_mca, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec, }, - { .ctl_name = 0 } + { } };static ctl_table sys_table[] = { { - .ctl_name =CTL_KERN , .procname ="kernel" , .mode =0555 , .child = kdump_ctl_table, }, - { .ctl_name =0 } + { } };#endif
arch/ia64/kernel/perfmon.c +0 -6
@@ -522,7 +522,6 @@ EXPORT_SYMBOL(pfm_sysctl);static ctl_table pfm_ctl_table[]={ { - .ctl_name =CTL_UNNUMBERED , .procname ="debug" , .data = &pfm_sysctl.debug, .maxlen =sizeof (int ),
@@ -530,7 +529,6 @@ static ctl_table pfm_ctl_table[]={ .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "debug_ovfl", .data = &pfm_sysctl.debug_ovfl, .maxlen = sizeof(int),
@@ -538,7 +536,6 @@ static ctl_table pfm_ctl_table[]={ .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "fastctxsw", .data = &pfm_sysctl.fastctxsw, .maxlen = sizeof(int),
@@ -546,7 +543,6 @@ static ctl_table pfm_ctl_table[]={ .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "expert_mode", .data = &pfm_sysctl.expert_mode, .maxlen = sizeof(int),
@@ -557,7 +553,6 @@ static ctl_table pfm_ctl_table[]={ };static ctl_table pfm_sysctl_dir[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="perfmon" , .mode =0555 , .child = pfm_ctl_table,
@@ -566,7 +561,6 @@ static ctl_table pfm_sysctl_dir[] = { };static ctl_table pfm_sysctl_root[] = { { - .ctl_name =CTL_KERN , .procname ="kernel" , .mode =0555 , .child = pfm_sysctl_dir,
drivers/misc/sgi-xp/xpc_main.c +0 -8
@@ -89,48 +89,40 @@ static int xpc_disengage_max_timelimit = 120;static ctl_table xpc_sys_xpc_hb_dir[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="hb_interval" , .data = &xpc_hb_interval, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xpc_hb_min_interval, .extra2 = &xpc_hb_max_interval}, { - .ctl_name =CTL_UNNUMBERED , .procname ="hb_check_interval" , .data = &xpc_hb_check_interval, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xpc_hb_check_min_interval, .extra2 = &xpc_hb_check_max_interval}, {} };static ctl_table xpc_sys_xpc_dir[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="hb" , .mode =0555 , .child = xpc_sys_xpc_hb_dir}, { - .ctl_name =CTL_UNNUMBERED , .procname ="disengage_timelimit" , .data = &xpc_disengage_timelimit, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &xpc_disengage_min_timelimit, .extra2 = &xpc_disengage_max_timelimit}, {} };static ctl_table xpc_sys_dir[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="xpc" , .mode =0555 , .child = xpc_sys_xpc_dir},
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 16/23 sysctl frv: Remove dead binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
--- arch/frv/kernel/pm.c | 106 +--------------------------------------------- arch/frv/kernel/sysctl.c | 3 - 2 files changed, 2 insertions(+), 107 deletions(-)
arch/frv/kernel/pm.c +2 -104
@@ -211,37 +211,6 @@ static int cmode_procctl(ctl_table *ctl, int write,return try_set_cmode (new_cmode)?:*lenp; } -static int cmode_sysctl (ctl_table *table, -void __user *oldval,size_t __user *oldlenp, -void __user *newval,size_t newlen) -{ -if (oldval && oldlenp) { -size_t oldlen; - -if (get_user (oldlen, oldlenp)) -return -EFAULT ; - -if (oldlen !=sizeof (int )) -return -EINVAL ; - -if (put_user (clock_cmode_current, (unsigned __user *)oldval) || -put_user (sizeof (int ), oldlenp)) -return -EFAULT ; - } -if (newval && newlen) { -int new_cmode; - -if (newlen !=sizeof (int )) -return -EINVAL ; - -if (get_user (new_cmode, (int __user *)newval)) -return -EFAULT ; - -return try_set_cmode (new_cmode)?:1 ; - } -return 1 ; -} -static int try_set_p0 (int new_p0) {unsigned long flags, clkc;
@@ -314,37 +283,6 @@ static int p0_procctl(ctl_table *ctl, int write,return try_set_p0 (new_p0)?:*lenp; } -static int p0_sysctl (ctl_table *table, -void __user *oldval,size_t __user *oldlenp, -void __user *newval,size_t newlen) -{ -if (oldval && oldlenp) { -size_t oldlen; - -if (get_user (oldlen, oldlenp)) -return -EFAULT ; - -if (oldlen !=sizeof (int )) -return -EINVAL ; - -if (put_user (clock_p0_current, (unsigned __user *)oldval) || -put_user (sizeof (int ), oldlenp)) -return -EFAULT ; - } -if (newval && newlen) { -int new_p0; - -if (newlen !=sizeof (int )) -return -EINVAL ; - -if (get_user (new_p0, (int __user *)newval)) -return -EFAULT ; - -return try_set_p0 (new_p0)?:1 ; - } -return 1 ; -} -static int cm_procctl (ctl_table *ctl,int write,void __user *buffer,size_t *lenp,loff_t *fpos) {
@@ -358,42 +296,9 @@ static int cm_procctl(ctl_table *ctl, int write,return try_set_cm (new_cm)?:*lenp; } -static int cm_sysctl (ctl_table *table, -void __user *oldval,size_t __user *oldlenp, -void __user *newval,size_t newlen) -{ -if (oldval && oldlenp) { -size_t oldlen; - -if (get_user (oldlen, oldlenp)) -return -EFAULT ; - -if (oldlen !=sizeof (int )) -return -EINVAL ; - -if (put_user (clock_cm_current, (unsigned __user *)oldval) || -put_user (sizeof (int ), oldlenp)) -return -EFAULT ; - } -if (newval && newlen) { -int new_cm; - -if (newlen !=sizeof (int )) -return -EINVAL ; - -if (get_user (new_cm, (int __user *)newval)) -return -EFAULT ; - -return try_set_cm (new_cm)?:1 ; - } -return 1 ; -} - -static struct ctl_table pm_table[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="suspend" , .data =NULL , .maxlen =0 ,
@@ -401,44 +306,37 @@ static struct ctl_table pm_table[] = .proc_handler = &sysctl_pm_do_suspend, }, { - .ctl_name = CTL_PM_CMODE, .procname = "cmode", .data = &clock_cmode_current, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &cmode_procctl, - .strategy = &cmode_sysctl, }, { - .ctl_name = CTL_PM_P0, .procname = "p0", .data = &clock_p0_current, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &p0_procctl, - .strategy = &p0_sysctl, }, { - .ctl_name = CTL_PM_CM, .procname = "cm", .data = &clock_cm_current, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &cm_procctl, - .strategy = &cm_sysctl, }, - { .ctl_name = 0} + { } }; static struct ctl_table pm_dir_table[] = { { - .ctl_name = CTL_PM, .procname = "pm", .mode = 0555, .child = pm_table, }, - { .ctl_name = 0} + { } }; /*
arch/frv/kernel/sysctl.c +0 -3
@@ -176,7 +176,6 @@ static int procctl_frv_pin_cxnr(ctl_table *table, int write, struct file *filp,static struct ctl_table frv_table[] = { { - .ctl_name =CTL_UNNUMBERD , .procname ="cache-mode" , .data =NULL , .maxlen =0 ,
@@ -185,7 +184,6 @@ static struct ctl_table frv_table[] = },#ifdef CONFIG_MMU { - .ctl_name = CTL_UNNUMBERD, .procname = "pin-cxnr", .data = NULL, .maxlen = 0,
@@ -203,7 +201,6 @@ static struct ctl_table frv_table[] =static struct ctl_table frv_dir_table[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="frv" , .mode =0555 , .child = frv_table
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 15/23 sysctl mips/lasat: Remove dead binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
The deleted strategy routines here surprise me. ctl_name was CTL_UNNUMBERED so they would not have been called at all.
--- arch/mips/lasat/sysctl.c | 99 +--------------------------------------------- 1 files changed, 1 insertions(+), 98 deletions(-)
arch/mips/lasat/sysctl.c +1 -98
@@ -37,23 +37,6 @@#include "ds1603.h" #endif -/* Strategy function to write EEPROM after changing string entry */ -int sysctl_lasatstring (ctl_table *table, -void *oldval,size_t *oldlenp, -void *newval,size_t newlen) -{ -int r; - - r =sysctl_string (table, oldval, oldlenp, newval, newlen); -if (r <0 ) -return r; - -if (newval && newlen) -lasat_write_eeprom_info (); - -return 0 ; -} -/* And the same for proc */ int proc_dolasatstring(ctl_table *table, int write,
@@ -113,46 +96,6 @@ int proc_dolasatrtc(ctl_table *table, int write, }#endif -/* Sysctl for setting the IP addresses */ -int sysctl_lasat_intvec (ctl_table *table, -void *oldval,size_t *oldlenp, -void *newval,size_t newlen) -{ -int r; - - r =sysctl_intvec (table, oldval, oldlenp, newval, newlen); -if (r <0 ) -return r; - -if (newval && newlen) -lasat_write_eeprom_info (); - -return 0 ; -} - -#ifdef CONFIG_DS1603 -/* Same for RTC */ -int sysctl_lasat_rtc (ctl_table *table, -void *oldval,size_t *oldlenp, -void *newval,size_t newlen) -{ -struct timespec ts; -int r; - -read_persistent_clock (&ts); - rtctmp = ts.tv_sec; -if (rtctmp <0 ) - rtctmp =0 ; - r =sysctl_intvec (table, oldval, oldlenp, newval, newlen); -if (r <0 ) -return r; -if (newval && newlen) -rtc_mips_set_mmss (rtctmp); - -return r; -} -#endif -#ifdef CONFIG_INET int proc_lasat_ip (ctl_table *table,int write,void *buffer,size_t *lenp,loff_t *ppos)
@@ -214,23 +157,6 @@ int proc_lasat_ip(ctl_table *table, int write, }#endif -static int sysctl_lasat_prid (ctl_table *table, -void *oldval,size_t *oldlenp, -void *newval,size_t newlen) -{ -int r; - - r =sysctl_intvec (table, oldval, oldlenp, newval, newlen); -if (r <0 ) -return r; -if (newval && newlen) { - lasat_board_info.li_eeprom_info.prid = *(int *)newval; -lasat_write_eeprom_info (); -lasat_init_board_info (); - } -return 0 ; -} -int proc_lasat_prid (ctl_table *table,int write,void *buffer,size_t *lenp,loff_t *ppos) {
@@ -252,115 +178,92 @@ extern int lasat_boot_to_service;static ctl_table lasat_table[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="cpu-hz" , .data = &lasat_board_info.li_cpu_hz, .maxlen =sizeof (int ), .mode =0444 , .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec }, { - .ctl_name =CTL_UNNUMBERED , .procname ="bus-hz" , .data = &lasat_board_info.li_bus_hz, .maxlen =sizeof (int ), .mode =0444 , .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec }, { - .ctl_name =CTL_UNNUMBERED , .procname ="bmid" , .data = &lasat_board_info.li_bmid, .maxlen =sizeof (int ), .mode =0444 , .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec }, { - .ctl_name =CTL_UNNUMBERED , .procname ="prid" , .data = &lasat_board_info.li_prid, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_lasat_prid, - .strategy = &sysctl_lasat_prid - }, +. }, #ifdef CONFIG_INET { - .ctl_name =CTL_UNNUMBERED , .procname ="ipaddr" , .data = &lasat_board_info.li_eeprom_info.ipaddr, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_lasat_ip, - .strategy = &sysctl_lasat_intvec }, { - .ctl_name =CTL_UNNUMBERED , .procname ="netmask" , .data = &lasat_board_info.li_eeprom_info.netmask, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_lasat_ip, - .strategy = &sysctl_lasat_intvec }, #endif { - .ctl_name =CTL_UNNUMBERED , .procname ="passwd_hash" , .data = &lasat_board_info.li_eeprom_info.passwd_hash, .maxlen =sizeof (lasat_board_info.li_eeprom_info.passwd_hash), .mode =0600 , .proc_handler = &proc_dolasatstring, - .strategy = &sysctl_lasatstring }, { - .ctl_name =CTL_UNNUMBERED , .procname ="boot-service" , .data = &lasat_boot_to_service, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec }, #ifdef CONFIG_DS1603 { - .ctl_name =CTL_UNNUMBERED , .procname ="rtc" , .data = &rtctmp, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dolasatrtc, - .strategy = &sysctl_lasat_rtc }, #endif { - .ctl_name =CTL_UNNUMBERED , .procname ="namestr" , .data = &lasat_board_info.li_namestr, .maxlen =sizeof (lasat_board_info.li_namestr), .mode =0444 , .proc_handler = &proc_dostring, - .strategy = &sysctl_string }, { - .ctl_name =CTL_UNNUMBERED , .procname ="typestr" , .data = &lasat_board_info.li_typestr, .maxlen =sizeof (lasat_board_info.li_typestr), .mode =0444 , .proc_handler = &proc_dostring, - .strategy = &sysctl_string }, {} };static ctl_table lasat_root_table[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="lasat" , .mode =0555 , .child = lasat_table
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 14/23 sysctl drivers: Remove dead binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a wrapper around /proc/sys all of the binary sysctl support elsewhere in the tree is dead code.
--- drivers/cdrom/cdrom.c | 8 ++---- drivers/char/hpet.c | 9 ++----- drivers/char/ipmi/ipmi_poweroff.c | 9 ++----- drivers/char/pty.c | 10 +------- drivers/char/random.c | 42 +------------------------------------ drivers/char/rtc.c | 9 ++----- drivers/macintosh/mac_hid.c | 11 ++------- drivers/md/md.c | 10 ++------ drivers/parport/procfs.c | 11 ++------- drivers/scsi/scsi_sysctl.c | 9 ++----- 10 files changed, 27 insertions(+), 101 deletions(-)
drivers/cdrom/cdrom.c +3 -5
@@ -3594,30 +3594,28 @@ static ctl_table cdrom_table[] = { .mode = 0644, .proc_handler = &cdrom_sysctl_handler }, - { .ctl_name = 0 } + { } };static ctl_table cdrom_cdrom_table[] = { { - .ctl_name =DEV_CDROM , .procname ="cdrom" , .maxlen =0 , .mode =0555 , .child = cdrom_table, }, - { .ctl_name =0 } + { } };/* Make sure that /proc/sys/dev is there */ static ctl_table cdrom_root_table[] = { { - .ctl_name =CTL_DEV , .procname ="dev" , .maxlen =0 , .mode =0555 , .child = cdrom_cdrom_table, }, - { .ctl_name =0 } + { } };static struct ctl_table_header *cdrom_sysctl_header;
drivers/char/hpet.c +3 -6
@@ -675,36 +675,33 @@ static int hpet_is_known(struct hpet_data *hdp)static ctl_table hpet_table[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="max-user-freq" , .data = &hpet_max_freq, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec, }, - {.ctl_name =0 } + {} };static ctl_table hpet_root[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="hpet" , .maxlen =0 , .mode =0555 , .child = hpet_table, }, - {.ctl_name =0 } + {} };static ctl_table dev_root[] = { { - .ctl_name =CTL_DEV , .procname ="dev" , .maxlen =0 , .mode =0555 , .child = hpet_root, }, - {.ctl_name =0 } + {} };static struct ctl_table_header *sysctl_header;
drivers/char/ipmi/ipmi_poweroff.c +3 -6
@@ -660,8 +660,7 @@ static struct ipmi_smi_watcher smi_watcher = {#include <linux/sysctl.h> static ctl_table ipmi_table[] = { - { .ctl_name =DEV_IPMI_POWEROFF_POWERCYCLE , - .procname ="poweroff_powercycle" , + { .procname ="poweroff_powercycle" , .data = &poweroff_powercycle, .maxlen =sizeof (poweroff_powercycle), .mode =0644 ,
@@ -670,16 +669,14 @@ static ctl_table ipmi_table[] = { };static ctl_table ipmi_dir_table[] = { - { .ctl_name =DEV_IPMI , - .procname ="ipmi" , + { .procname ="ipmi" , .mode =0555 , .child = ipmi_table }, { } };static ctl_table ipmi_root_table[] = { - { .ctl_name =CTL_DEV , - .procname ="dev" , + { .procname ="dev" , .mode =0555 , .child = ipmi_dir_table }, { }
drivers/char/pty.c +2 -8
@@ -431,30 +431,25 @@ static struct cdev ptmx_cdev;static struct ctl_table pty_table[] = { { - .ctl_name =PTY_MAX , .procname ="max" , .maxlen =sizeof (int ), .mode =0644 , .data = &pty_limit, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &pty_limit_min, .extra2 = &pty_limit_max, }, { - .ctl_name =PTY_NR , .procname ="nr" , .maxlen =sizeof (int ), .mode =0444 , .data = &pty_count, .proc_handler = &proc_dointvec, - }, { - .ctl_name =0 - } + }, + {} };static struct ctl_table pty_kern_table[] = { { - .ctl_name =KERN_PTY , .procname ="pty" , .mode =0555 , .child = pty_table,
@@ -464,7 +459,6 @@ static struct ctl_table pty_kern_table[] = {static struct ctl_table pty_root_table[] = { { - .ctl_name =CTL_KERN , .procname ="kernel" , .mode =0555 , .child = pty_kern_table,
drivers/char/random.c +1 -41
93 lines not on this page · raw message
drivers/char/rtc.c +3 -6
@@ -282,34 +282,31 @@ static irqreturn_t rtc_interrupt(int irq, void *dev_id)*/ static ctl_table rtc_table[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="max-user-freq" , .data = &rtc_max_user_freq, .maxlen =sizeof (int ), .mode =0644 , .proc_handler = &proc_dointvec, }, - { .ctl_name =0 } + { } };static ctl_table rtc_root[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="rtc" , .mode =0555 , .child = rtc_table, }, - { .ctl_name =0 } + { } };static ctl_table dev_root[] = { { - .ctl_name =CTL_DEV , .procname ="dev" , .mode =0555 , .child = rtc_root, }, - { .ctl_name =0 } + { } };static struct ctl_table_header *sysctl_header;
drivers/macintosh/mac_hid.c +3 -8
@@ -27,7 +27,6 @@ static int mouse_last_keycode;/* file(s) in /proc/sys/dev/mac_hid */ static ctl_table mac_hid_files[] = { { - .ctl_name =DEV_MAC_HID_MOUSE_BUTTON_EMULATION , .procname ="mouse_button_emulation" , .data = &mouse_emulate_buttons, .maxlen =sizeof (int ),
@@ -35,7 +34,6 @@ static ctl_table mac_hid_files[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = DEV_MAC_HID_MOUSE_BUTTON2_KEYCODE, .procname = "mouse_button2_keycode", .data = &mouse_button2_keycode, .maxlen = sizeof(int),
@@ -43,38 +41,35 @@ static ctl_table mac_hid_files[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = DEV_MAC_HID_MOUSE_BUTTON3_KEYCODE, .procname = "mouse_button3_keycode", .data = &mouse_button3_keycode, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec, }, - { .ctl_name = 0 } + { } };/* dir in /proc/sys/dev */ static ctl_table mac_hid_dir[] = { { - .ctl_name =DEV_MAC_HID , .procname ="mac_hid" , .maxlen =0 , .mode =0555 , .child = mac_hid_files, }, - { .ctl_name =0 } + { } };/* /proc/sys/dev itself, in case that is not there yet */ static ctl_table mac_hid_root_dir[] = { { - .ctl_name =CTL_DEV , .procname ="dev" , .maxlen =0 , .mode =0555 , .child = mac_hid_dir, }, - { .ctl_name =0 } + { } };static struct ctl_table_header *mac_hid_sysctl_header;
drivers/md/md.c +3 -7
@@ -98,7 +98,6 @@ static struct ctl_table_header *raid_table_header;static ctl_table raid_table[] = { { - .ctl_name =DEV_RAID_SPEED_LIMIT_MIN , .procname ="speed_limit_min" , .data = &sysctl_speed_limit_min, .maxlen =sizeof (int ),
@@ -106,36 +105,33 @@ static ctl_table raid_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = DEV_RAID_SPEED_LIMIT_MAX, .procname = "speed_limit_max", .data = &sysctl_speed_limit_max, .maxlen = sizeof(int), .mode = S_IRUGO|S_IWUSR, .proc_handler = &proc_dointvec, }, - { .ctl_name = 0 } + { } };static ctl_table raid_dir_table[] = { { - .ctl_name =DEV_RAID , .procname ="raid" , .maxlen =0 , .mode =S_IRUGO |S_IXUGO , .child = raid_table, }, - { .ctl_name =0 } + { } };static ctl_table raid_root_table[] = { { - .ctl_name =CTL_DEV , .procname ="dev" , .maxlen =0 , .mode =0555 , .child = raid_dir_table, }, - { .ctl_name =0 } + { } };static const struct block_device_operations md_fops;
drivers/parport/procfs.c +3 -8
@@ -233,10 +233,10 @@ static int do_hardware_modes (ctl_table *table, int write,return copy_to_user (result, buffer, len) ? -EFAULT :0 ; } -#define PARPORT_PORT_DIR (CHILD ) { .ctl_name = 0, .procname = NULL, .mode = 0555, .child = CHILD } -#define PARPORT_PARPORT_DIR (CHILD ) { .ctl_name = DEV_PARPORT, .procname = "parport", \ +#define PARPORT_PORT_DIR (CHILD ) { .procname = NULL, .mode = 0555, .child = CHILD } +#define PARPORT_PARPORT_DIR (CHILD ) { .procname = "parport", \ .mode = 0555, .child = CHILD } -#define PARPORT_DEV_DIR (CHILD ) { .ctl_name = CTL_DEV, .procname = "dev", .mode = 0555, .child = CHILD } +#define PARPORT_DEV_DIR (CHILD ) { .procname = "dev", .mode = 0555, .child = CHILD }#define PARPORT_DEVICES_ROOT_DIR { .procname = "devices", \ .mode = 0555, .child = NULL }
@@ -393,7 +393,6 @@ parport_device_sysctl_template = { }, { { - .ctl_name = 0, .procname = NULL, .data = NULL, .maxlen = 0,
@@ -455,7 +454,6 @@ parport_default_sysctl_table = { }, { { - .ctl_name = DEV_PARPORT_DEFAULT, .procname = "default", .mode =0555 , .child = parport_default_sysctl_table.vars
@@ -495,7 +493,6 @@ int parport_proc_register(struct parport *port) t->vars[6 + i].extra2 = &port->probe_info[i]; t->port_dir[0 ].procname = port->name; - t->port_dir[0 ].ctl_name =0 ; t->port_dir[0 ].child = t->vars; t->parport_dir[0 ].child = t->port_dir;
@@ -534,11 +531,9 @@ int parport_device_proc_register(struct pardevice *device) t->dev_dir[0 ].child = t->parport_dir; t->parport_dir[0 ].child = t->port_dir; t->port_dir[0 ].procname = port->name; - t->port_dir[0 ].ctl_name =0 ; t->port_dir[0 ].child = t->devices_root_dir; t->devices_root_dir[0 ].child = t->device_dir; - t->device_dir[0 ].ctl_name =0 ; t->device_dir[0 ].procname = device->name; t->device_dir[0 ].child = t->vars; t->vars[0 ].data = &device->timeslice;
drivers/scsi/scsi_sysctl.c +3 -6
@@ -13,8 +13,7 @@static ctl_table scsi_table[] = { - { .ctl_name =DEV_SCSI_LOGGING_LEVEL , - .procname ="logging_level" , + { .procname ="logging_level" , .data = &scsi_logging_level, .maxlen =sizeof (scsi_logging_level), .mode =0644 ,
@@ -23,16 +22,14 @@ static ctl_table scsi_table[] = { };static ctl_table scsi_dir_table[] = { - { .ctl_name =DEV_SCSI , - .procname ="scsi" , + { .procname ="scsi" , .mode =0555 , .child = scsi_table }, { } };static ctl_table scsi_root_table[] = { - { .ctl_name =CTL_DEV , - .procname ="dev" , + { .procname ="dev" , .mode =0555 , .child = scsi_dir_table }, { }
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 12/23 sysctl security/keys: Remove dead binary sysctl support
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
--- security/keys/sysctl.c | 7 +------ 1 files changed, 1 insertions(+), 6 deletions(-)
security/keys/sysctl.c +1 -6
@@ -17,7 +17,6 @@ static const int zero, one = 1, max = INT_MAX;ctl_table key_sysctls[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="maxkeys" , .data = &key_quota_maxkeys, .maxlen =sizeof (unsigned ),
@@ -27,7 +26,6 @@ ctl_table key_sysctls[] = { .extra2 = (void *) &max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "maxbytes", .data = &key_quota_maxbytes, .maxlen = sizeof(unsigned),
@@ -37,7 +35,6 @@ ctl_table key_sysctls[] = { .extra2 = (void *) &max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "root_maxkeys", .data = &key_quota_root_maxkeys, .maxlen = sizeof(unsigned),
@@ -47,7 +44,6 @@ ctl_table key_sysctls[] = { .extra2 = (void *) &max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "root_maxbytes", .data = &key_quota_root_maxbytes, .maxlen = sizeof(unsigned),
@@ -57,7 +53,6 @@ ctl_table key_sysctls[] = { .extra2 = (void *) &max, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "gc_delay", .data = &key_gc_delay, .maxlen = sizeof(unsigned),
@@ -66,5 +61,5 @@ ctl_table key_sysctls[] = { .extra1 = (void *) &zero, .extra2 = (void *) &max, }, - { .ctl_name = 0 } + { } };
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 11/23 sysctl kernel: Remove binary sysctl logic
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
--- kernel/sched.c | 5 ++--- kernel/slow-work.c | 5 +---- kernel/utsname_sysctl.c | 31 ------------------------------- 3 files changed, 3 insertions(+), 38 deletions(-)
kernel/sched.c +2 -3
@@ -7373,17 +7373,16 @@ static struct ctl_table sd_ctl_dir[] = { .procname = "sched_domain", .mode = 0555, }, - {0, }, + {} };static struct ctl_table sd_ctl_root[] = { { - .ctl_name =CTL_KERN , .procname ="kernel" , .mode =0555 , .child = sd_ctl_dir, }, - {0 , }, + {} };static struct ctl_table *sd_alloc_ctl_entry (int n)
kernel/slow-work.c +1 -4
@@ -52,7 +52,6 @@ static const int slow_work_max_vslow = 99;ctl_table slow_work_sysctls[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="min-threads" , .data = &slow_work_min_threads, .maxlen =sizeof (unsigned ),
@@ -62,7 +61,6 @@ ctl_table slow_work_sysctls[] = { .extra2 = &slow_work_max_threads, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "max-threads", .data = &slow_work_max_threads, .maxlen = sizeof(unsigned),
@@ -72,7 +70,6 @@ ctl_table slow_work_sysctls[] = { .extra2 = (void *) &slow_work_max_max_threads, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "vslow-percentage", .data = &vslow_work_proportion, .maxlen = sizeof(unsigned),
@@ -81,7 +78,7 @@ ctl_table slow_work_sysctls[] = { .extra1 = (void *) &slow_work_min_vslow, .extra2 = (void *) &slow_work_max_vslow, }, - { .ctl_name = 0 } + {} };#endif
kernel/utsname_sysctl.c +0 -31
@@ -57,78 +57,47 @@ static int proc_do_uts_string(ctl_table *table, int write,#define proc_do_uts_string NULL#endif - -#ifdef CONFIG_SYSCTL_SYSCALL -/* The generic string strategy routine: */ -static int sysctl_uts_string (ctl_table *table, -void __user *oldval,size_t __user *oldlenp, -void __user *newval,size_t newlen) -{ -struct ctl_table uts_table; -int r, write; - write = newval && newlen; -memcpy (&uts_table, table,sizeof (uts_table)); - uts_table.data =get_uts (table, write); - r =sysctl_string (&uts_table, oldval, oldlenp, newval, newlen); -put_uts (table, write, uts_table.data); -return r; -} -#else -#define sysctl_uts_string NULL -#endif -static struct ctl_table uts_kern_table[] = { { - .ctl_name =KERN_OSTYPE , .procname ="ostype" , .data = init_uts_ns.name.sysname, .maxlen =sizeof (init_uts_ns.name.sysname), .mode =0444 , .proc_handler = proc_do_uts_string, - .strategy = sysctl_uts_string, }, { - .ctl_name =KERN_OSRELEASE , .procname ="osrelease" , .data = init_uts_ns.name.release, .maxlen =sizeof (init_uts_ns.name.release), .mode =0444 , .proc_handler = proc_do_uts_string, - .strategy = sysctl_uts_string, }, { - .ctl_name =KERN_VERSION , .procname ="version" , .data = init_uts_ns.name.version, .maxlen =sizeof (init_uts_ns.name.version), .mode =0444 , .proc_handler = proc_do_uts_string, - .strategy = sysctl_uts_string, }, { - .ctl_name =KERN_NODENAME , .procname ="hostname" , .data = init_uts_ns.name.nodename, .maxlen =sizeof (init_uts_ns.name.nodename), .mode =0644 , .proc_handler = proc_do_uts_string, - .strategy = sysctl_uts_string, }, { - .ctl_name =KERN_DOMAINNAME , .procname ="domainname" , .data = init_uts_ns.name.domainname, .maxlen =sizeof (init_uts_ns.name.domainname), .mode =0644 , .proc_handler = proc_do_uts_string, - .strategy = sysctl_uts_string, }, {} };static struct ctl_table uts_root_table[] = { { - .ctl_name =CTL_KERN , .procname ="kernel" , .mode =0555 , .child = uts_kern_table,
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 7/23 sysctl: Don't look at ctl_name and strategy in the generic code
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
The ctl_name and strategy fields are unused, now that sys_sysctl is a compatibility wrapper around /proc/sys. No longer looking at them in the generic code is effectively what we are doing now and provides the guarantee that during further cleanups we can just remove references to those fields and everything will work ok.
--- fs/proc/proc_sysctl.c | 4 ++-- include/linux/sysctl.h | 17 ++--------------- kernel/sysctl.c | 29 +++++++---------------------- 3 files changed, 11 insertions(+), 39 deletions(-)
fs/proc/proc_sysctl.c +2 -2
@@ -48,7 +48,7 @@ out:static struct ctl_table *find_in_table (struct ctl_table *p,struct qstr *name) {int len; -for ( ; p->ctl_name || p->procname; p++) { +for ( ; p->procname; p++) {if (!p->procname)continue ;
@@ -218,7 +218,7 @@ static int scan(struct ctl_table_header *head, ctl_table *table, void *dirent, filldir_t filldir) { -for (; table->ctl_name || table->procname; table++, (*pos)++) { +for (; table->procname; table++, (*pos)++) {int res;/* Can't do anything without a proc name */
include/linux/sysctl.h +2 -15
@@ -1005,8 +1005,8 @@ extern ctl_handler sysctl_ms_jiffies;/* * Register a set of sysctl names by calling register_sysctl_table -* with an initialised array of struct ctl_table's. An entry with zero -* ctl_name and NULL procname terminates the table. table->de will be +* with an initialised array of struct ctl_table's. An entry with +* NULL procname terminates the table. table->de will be * set up by the registration and need not be initialised in advance. * * sysctl names can be mirrored automatically under /proc/sys. The
@@ -1019,24 +1019,11 @@ extern ctl_handler sysctl_ms_jiffies;* under /proc; non-leaf nodes will be represented by directories. A * null procname disables /proc mirroring at this node. * -* sysctl entries with a zero ctl_name will not be available through -* the binary sysctl interface. -* * sysctl(2) can automatically manage read and write requests through * the sysctl table. The data and maxlen fields of the ctl_table * struct enable minimal validation of the values being written to be * performed, and the mode field allows minimal authentication. * -* More sophisticated management can be enabled by the provision of a -* strategy routine with the table entry. This will be called before -* any automatic read or write of the data is performed. -* -* The strategy routine may return: -* <0: Error occurred (error is passed to user process) -* 0: OK - proceed with automatic read or write. -* >0: OK - read or write has been done by the strategy routine, so -* return immediately. -* * There must be a proc_handler routine for any terminal nodes * mirrored under /proc/sys (non-terminals are handled by a built-in * directory handler). Several default handlers are available to
kernel/sysctl.c +7 -22
@@ -1618,7 +1618,7 @@ int sysctl_perm(struct ctl_table_root *root, struct ctl_table *table, int op)static void sysctl_set_parent (struct ctl_table *parent,struct ctl_table *table) { -for (; table->ctl_name || table->procname; table++) { +for (; table->procname; table++) { table->parent = parent;if (table->child)sysctl_set_parent (table, table->child);
@@ -1650,11 +1650,11 @@ static struct ctl_table *is_branch_in(struct ctl_table *branch,return NULL ;/* ... and nothing else */ -if (branch[1 ].procname || branch[1 ].ctl_name) +if (branch[1 ].procname)return NULL ;/* table should contain subdirectory with the same name */ -for (p = table; p->procname || p->ctl_name; p++) { +for (p = table; p->procname; p++) {if (!p->child)continue ;if (p->procname &&strcmp (p->procname, s) ==0 )
@@ -1699,8 +1699,7 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q)* * The members of the &struct ctl_table structure are used as follows: * -* ctl_name - This is the numeric sysctl value used by sysctl(2). The number -* must be unique within that level of sysctl +* ctl_name - Dead * * procname - the name of the sysctl file under /proc/sys. Set to %NULL to not * enter a sysctl file
@@ -1716,7 +1715,7 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q)* * proc_handler - the text handler routine (described below) * -* strategy - the strategy routine (described below) +* strategy - Dead * * de - for internal use by the sysctl routines *
@@ -1730,19 +1729,6 @@ static void try_attach(struct ctl_table_header *p, struct ctl_table_header *q)* struct enable minimal validation of the values being written to be * performed, and the mode field allows minimal authentication. * -* More sophisticated management can be enabled by the provision of a -* strategy routine with the table entry. This will be called before -* any automatic read or write of the data is performed. -* -* The strategy routine may return -* -* < 0 - Error occurred (error is passed to user process) -* -* 0 - OK - proceed with automatic read or write. -* -* > 0 - OK - read or write has been done by the strategy routine, so -* return immediately. -* * There must be a proc_handler routine for any terminal nodes * mirrored under /proc/sys (non-terminals are handled by a built-in * directory handler). Several default handlers are available to
@@ -1769,13 +1755,13 @@ struct ctl_table_header *__register_sysctl_paths(struct ctl_table_set *set;/* Count the path components */ -for (npath =0 ; path[npath].ctl_name || path[npath].procname; ++npath) +for (npath =0 ; path[npath].procname; ++npath) ;/* * For each path component, allocate a 2-element ctl_table array. * The first array element will be filled with the sysctl entry -* for this, the second will be the sentinel (ctl_name == 0). +* for this, the second will be the sentinel (procname == 0). * * We allocate everything in one go so that we don't have to * worry about freeing additional memory in unregister_sysctl_table.
@@ -1792,7 +1778,6 @@ struct ctl_table_header *__register_sysctl_paths(for (n =0 ; n < npath; ++n, ++path) {/* Copy the procname */ new->procname = path->procname; - new->ctl_name = path->ctl_name; new->mode =0555 ; *prevp = new;
Signature · 1 line
1.6.5.2.143.g8cc62
PATCH 6/23 sysctl: Remove references to ctl_name and strategy from the generic sysctl table
In reply to Eric W. BiedermanFrom: Eric W. Biederman <[email protected]>
Now that sys_sysctl is a generic wrapper around /proc/sys .ctl_name and .strategy members of sysctl tables are dead code. Remove them.
--- kernel/sysctl.c | 195 ++----------------------------------------------------- 1 files changed, 7 insertions(+), 188 deletions(-)
kernel/sysctl.c +7 -188
@@ -205,31 +205,26 @@ extern int lock_stat;static struct ctl_table root_table[] = { { - .ctl_name =CTL_KERN , .procname ="kernel" , .mode =0555 , .child = kern_table, }, { - .ctl_name =CTL_VM , .procname ="vm" , .mode =0555 , .child = vm_table, }, { - .ctl_name =CTL_FS , .procname ="fs" , .mode =0555 , .child = fs_table, }, { - .ctl_name =CTL_DEBUG , .procname ="debug" , .mode =0555 , .child = debug_table, }, { - .ctl_name =CTL_DEV , .procname ="dev" , .mode =0555 , .child = dev_table,
@@ -238,7 +233,7 @@ static struct ctl_table root_table[] = {* NOTE: do not add new entries to this table unless you have read * Documentation/sysctl/ctl_unnumbered.txt */ - { .ctl_name = 0 } + { } };#ifdef CONFIG_SCHED_DEBUG
@@ -250,7 +245,6 @@ static int max_wakeup_granularity_ns = NSEC_PER_SEC; /* 1 second */static struct ctl_table kern_table[] = { { - .ctl_name =CTL_UNNUMBERED , .procname ="sched_child_runs_first" , .data = &sysctl_sched_child_runs_first, .maxlen =sizeof (unsigned int ),
@@ -259,40 +253,33 @@ static struct ctl_table kern_table[] = { },#ifdef CONFIG_SCHED_DEBUG { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_min_granularity_ns", .data = &sysctl_sched_min_granularity, .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = &sched_nr_latency_handler, - .strategy = &sysctl_intvec, .extra1 = &min_sched_granularity_ns, .extra2 = &max_sched_granularity_ns, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_latency_ns", .data = &sysctl_sched_latency, .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = &sched_nr_latency_handler, - .strategy = &sysctl_intvec, .extra1 = &min_sched_granularity_ns, .extra2 = &max_sched_granularity_ns, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_wakeup_granularity_ns", .data = &sysctl_sched_wakeup_granularity, .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &min_wakeup_granularity_ns, .extra2 = &max_wakeup_granularity_ns, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_shares_ratelimit", .data = &sysctl_sched_shares_ratelimit, .maxlen = sizeof(unsigned int),
@@ -300,17 +287,14 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_shares_thresh", .data = &sysctl_sched_shares_thresh, .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_features", .data = &sysctl_sched_features, .maxlen = sizeof(unsigned int),
@@ -318,7 +302,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_migration_cost", .data = &sysctl_sched_migration_cost, .maxlen = sizeof(unsigned int),
@@ -326,7 +309,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_nr_migrate", .data = &sysctl_sched_nr_migrate, .maxlen = sizeof(unsigned int),
@@ -334,7 +316,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_time_avg", .data = &sysctl_sched_time_avg, .maxlen = sizeof(unsigned int),
@@ -342,19 +323,16 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "timer_migration", .data = &sysctl_timer_migration, .maxlen = sizeof(unsigned int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &one, }, #endif { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_rt_period_us", .data = &sysctl_sched_rt_period, .maxlen = sizeof(unsigned int),
@@ -362,7 +340,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &sched_rt_handler, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_rt_runtime_us", .data = &sysctl_sched_rt_runtime, .maxlen = sizeof(int),
@@ -370,7 +347,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &sched_rt_handler, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "sched_compat_yield", .data = &sysctl_sched_compat_yield, .maxlen = sizeof(unsigned int),
@@ -379,7 +355,6 @@ static struct ctl_table kern_table[] = { },#ifdef CONFIG_PROVE_LOCKING { - .ctl_name = CTL_UNNUMBERED, .procname = "prove_locking", .data = &prove_locking, .maxlen = sizeof(int),
@@ -389,7 +364,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_LOCK_STAT { - .ctl_name = CTL_UNNUMBERED, .procname = "lock_stat", .data = &lock_stat, .maxlen = sizeof(int),
@@ -398,7 +372,6 @@ static struct ctl_table kern_table[] = { },#endif { - .ctl_name = KERN_PANIC, .procname = "panic", .data = &panic_timeout, .maxlen = sizeof(int),
@@ -406,7 +379,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = KERN_CORE_USES_PID, .procname = "core_uses_pid", .data = &core_uses_pid, .maxlen = sizeof(int),
@@ -414,16 +386,13 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = KERN_CORE_PATTERN, .procname = "core_pattern", .data = core_pattern, .maxlen = CORENAME_MAX_SIZE, .mode = 0644, .proc_handler = &proc_dostring, - .strategy = &sysctl_string, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "core_pipe_limit", .data = &core_pipe_limit, .maxlen = sizeof(unsigned int),
@@ -449,7 +418,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_BLK_DEV_INITRD { - .ctl_name = KERN_REALROOTDEV, .procname = "real-root-dev", .data = &real_root_dev, .maxlen = sizeof(int),
@@ -458,7 +426,6 @@ static struct ctl_table kern_table[] = { },#endif { - .ctl_name = CTL_UNNUMBERED, .procname = "print-fatal-signals", .data = &print_fatal_signals, .maxlen = sizeof(int),
@@ -467,16 +434,13 @@ static struct ctl_table kern_table[] = { }, #ifdef CONFIG_SPARC { - .ctl_name = KERN_SPARC_REBOOT, .procname = "reboot-cmd", .data = reboot_command, .maxlen = 256, .mode = 0644, .proc_handler = &proc_dostring, - .strategy = &sysctl_string, }, { - .ctl_name = KERN_SPARC_STOP_A, .procname = "stop-a", .data = &stop_a_enabled, .maxlen = sizeof (int),
@@ -484,7 +448,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = KERN_SPARC_SCONS_PWROFF, .procname = "scons-poweroff", .data = &scons_pwroff, .maxlen = sizeof (int),
@@ -494,7 +457,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_SPARC64 { - .ctl_name = CTL_UNNUMBERED, .procname = "tsb-ratio", .data = &sysctl_tsb_ratio, .maxlen = sizeof (int),
@@ -504,7 +466,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef __hppa__ { - .ctl_name = KERN_HPPA_PWRSW, .procname = "soft-power", .data = &pwrsw_enabled, .maxlen = sizeof (int),
@@ -512,7 +473,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = KERN_HPPA_UNALIGNED, .procname = "unaligned-trap", .data = &unaligned_enabled, .maxlen = sizeof (int),
@@ -521,7 +481,6 @@ static struct ctl_table kern_table[] = { },#endif { - .ctl_name = KERN_CTLALTDEL, .procname = "ctrl-alt-del", .data = &C_A_D, .maxlen = sizeof(int),
@@ -530,7 +489,6 @@ static struct ctl_table kern_table[] = { },#ifdef CONFIG_FUNCTION_TRACER { - .ctl_name = CTL_UNNUMBERED, .procname = "ftrace_enabled", .data = &ftrace_enabled, .maxlen = sizeof(int),
@@ -540,7 +498,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_STACK_TRACER { - .ctl_name = CTL_UNNUMBERED, .procname = "stack_tracer_enabled", .data = &stack_tracer_enabled, .maxlen = sizeof(int),
@@ -550,7 +507,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_TRACING { - .ctl_name = CTL_UNNUMBERED, .procname = "ftrace_dump_on_oops", .data = &ftrace_dump_on_oops, .maxlen = sizeof(int),
@@ -560,16 +516,13 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_MODULES { - .ctl_name = KERN_MODPROBE, .procname = "modprobe", .data = &modprobe_path, .maxlen = KMOD_PATH_LEN, .mode = 0644, .proc_handler = &proc_dostring, - .strategy = &sysctl_string, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "modules_disabled", .data = &modules_disabled, .maxlen = sizeof(int),
@@ -582,18 +535,15 @@ static struct ctl_table kern_table[] = {#endif #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) { - .ctl_name = KERN_HOTPLUG, .procname = "hotplug", .data = &uevent_helper, .maxlen = UEVENT_HELPER_PATH_LEN, .mode = 0644, .proc_handler = &proc_dostring, - .strategy = &sysctl_string, }, #endif #ifdef CONFIG_CHR_DEV_SG { - .ctl_name = KERN_SG_BIG_BUFF, .procname = "sg-big-buff", .data = &sg_big_buff, .maxlen = sizeof (int),
@@ -603,7 +553,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_BSD_PROCESS_ACCT { - .ctl_name = KERN_ACCT, .procname = "acct", .data = &acct_parm, .maxlen = 3*sizeof(int),
@@ -613,7 +562,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_MAGIC_SYSRQ { - .ctl_name = KERN_SYSRQ, .procname = "sysrq", .data = &__sysrq_enabled, .maxlen = sizeof (int),
@@ -631,7 +579,6 @@ static struct ctl_table kern_table[] = { },#endif { - .ctl_name = KERN_MAX_THREADS, .procname = "threads-max", .data = &max_threads, .maxlen = sizeof(int),
@@ -639,37 +586,31 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = KERN_RANDOM, .procname = "random", .mode = 0555, .child = random_table, }, { - .ctl_name = KERN_OVERFLOWUID, .procname = "overflowuid", .data = &overflowuid, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &minolduid, .extra2 = &maxolduid, }, { - .ctl_name = KERN_OVERFLOWGID, .procname = "overflowgid", .data = &overflowgid, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &minolduid, .extra2 = &maxolduid, }, #ifdef CONFIG_S390 #ifdef CONFIG_MATHEMU { - .ctl_name = KERN_IEEE_EMULATION_WARNINGS, .procname = "ieee_emulation_warnings", .data = &sysctl_ieee_emulation_warnings, .maxlen = sizeof(int),
@@ -678,7 +619,6 @@ static struct ctl_table kern_table[] = { },#endif { - .ctl_name = KERN_S390_USER_DEBUG_LOGGING, .procname = "userprocess_debug", .data = &sysctl_userprocess_debug, .maxlen = sizeof(int),
@@ -687,18 +627,15 @@ static struct ctl_table kern_table[] = { },#endif { - .ctl_name = KERN_PIDMAX, .procname = "pid_max", .data = &pid_max, .maxlen = sizeof (int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = sysctl_intvec, .extra1 = &pid_max_min, .extra2 = &pid_max_max, }, { - .ctl_name = KERN_PANIC_ON_OOPS, .procname = "panic_on_oops", .data = &panic_on_oops, .maxlen = sizeof(int),
@@ -707,7 +644,6 @@ static struct ctl_table kern_table[] = { },#if definedCONFIG_PRINTK { - .ctl_name = KERN_PRINTK, .procname = "printk", .data = &console_loglevel, .maxlen = 4*sizeof(int),
@@ -715,16 +651,13 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = KERN_PRINTK_RATELIMIT, .procname = "printk_ratelimit", .data = &printk_ratelimit_state.interval, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_jiffies, - .strategy = &sysctl_jiffies, }, { - .ctl_name = KERN_PRINTK_RATELIMIT_BURST, .procname = "printk_ratelimit_burst", .data = &printk_ratelimit_state.burst, .maxlen = sizeof(int),
@@ -732,19 +665,16 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "printk_delay", .data = &printk_delay_msec, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &ten_thousand, },#endif { - .ctl_name = KERN_NGROUPS_MAX, .procname = "ngroups_max", .data = &ngroups_max, .maxlen = sizeof (int),
@@ -753,7 +683,6 @@ static struct ctl_table kern_table[] = { },#if defined(CONFIG_X86_LOCAL_APIC ) && defined(CONFIG_X86 ) { - .ctl_name = KERN_UNKNOWN_NMI_PANIC, .procname = "unknown_nmi_panic", .data = &unknown_nmi_panic, .maxlen = sizeof (int),
@@ -770,7 +699,6 @@ static struct ctl_table kern_table[] = {#endif #if defined(CONFIG_X86 ) { - .ctl_name = KERN_PANIC_ON_NMI, .procname = "panic_on_unrecovered_nmi", .data = &panic_on_unrecovered_nmi, .maxlen = sizeof(int),
@@ -778,7 +706,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "panic_on_io_nmi", .data = &panic_on_io_nmi, .maxlen = sizeof(int),
@@ -786,7 +713,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = KERN_BOOTLOADER_TYPE, .procname = "bootloader_type", .data = &bootloader_type, .maxlen = sizeof (int),
@@ -794,7 +720,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "bootloader_version", .data = &bootloader_version, .maxlen = sizeof (int),
@@ -802,7 +727,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "kstack_depth_to_print", .data = &kstack_depth_to_print, .maxlen = sizeof(int),
@@ -810,7 +734,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "io_delay_type", .data = &io_delay_type, .maxlen = sizeof(int),
@@ -820,7 +743,6 @@ static struct ctl_table kern_table[] = {#endif #if defined(CONFIG_MMU ) { - .ctl_name = KERN_RANDOMIZE, .procname = "randomize_va_space", .data = &randomize_va_space, .maxlen = sizeof(int),
@@ -830,7 +752,6 @@ static struct ctl_table kern_table[] = {#endif #if defined(CONFIG_S390 ) && defined(CONFIG_SMP ) { - .ctl_name = KERN_SPIN_RETRY, .procname = "spin_retry", .data = &spin_retry, .maxlen = sizeof (int),
@@ -849,7 +770,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_IA64 { - .ctl_name = KERN_IA64_UNALIGNED, .procname = "ignore-unaligned-usertrap", .data = &no_unaligned_warning, .maxlen = sizeof (int),
@@ -857,7 +777,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "unaligned-dump-stack", .data = &unaligned_dump_stack, .maxlen = sizeof (int),
@@ -867,71 +786,58 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_DETECT_SOFTLOCKUP { - .ctl_name = CTL_UNNUMBERED, .procname = "softlockup_panic", .data = &softlockup_panic, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &one, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "softlockup_thresh", .data = &softlockup_thresh, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dosoftlockup_thresh, - .strategy = &sysctl_intvec, .extra1 = &neg_one, .extra2 = &sixty, }, #endif #ifdef CONFIG_DETECT_HUNG_TASK { - .ctl_name =CTL_UNNUMBERED , .procname = "hung_task_panic", .data = &sysctl_hung_task_panic, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &one, }, { - .ctl_name =CTL_UNNUMBERED , .procname = "hung_task_check_count", .data = &sysctl_hung_task_check_count, .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = &proc_doulongvec_minmax, - .strategy = &sysctl_intvec, }, { - .ctl_name =CTL_UNNUMBERED , .procname = "hung_task_timeout_secs", .data = &sysctl_hung_task_timeout_secs, .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = &proc_dohung_task_timeout_secs, - .strategy = &sysctl_intvec, }, { - .ctl_name =CTL_UNNUMBERED , .procname = "hung_task_warnings", .data = &sysctl_hung_task_warnings, .maxlen = sizeof(unsigned long), .mode = 0644, .proc_handler = &proc_doulongvec_minmax, - .strategy = &sysctl_intvec, }, #endif #ifdef CONFIG_COMPAT { - .ctl_name =KERN_COMPAT_LOG , .procname = "compat-log", .data = &compat_log, .maxlen = sizeof (int),
@@ -941,7 +847,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_RT_MUTEXES { - .ctl_name = KERN_MAX_LOCK_DEPTH, .procname = "max_lock_depth", .data = &max_lock_depth, .maxlen = sizeof(int),
@@ -950,17 +855,14 @@ static struct ctl_table kern_table[] = { },#endif { - .ctl_name = CTL_UNNUMBERED, .procname = "poweroff_cmd", .data = &poweroff_cmd, .maxlen = POWEROFF_CMD_PATH_LEN, .mode = 0644, .proc_handler = &proc_dostring, - .strategy = &sysctl_string, }, #ifdef CONFIG_KEYS { - .ctl_name = CTL_UNNUMBERED, .procname = "keys", .mode = 0555, .child = key_sysctls,
@@ -968,7 +870,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_RCU_TORTURE_TEST { - .ctl_name = CTL_UNNUMBERED, .procname = "rcutorture_runnable", .data = &rcutorture_runnable, .maxlen = sizeof(int),
@@ -978,7 +879,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_SLOW_WORK { - .ctl_name = CTL_UNNUMBERED, .procname = "slow-work", .mode = 0555, .child = slow_work_sysctls,
@@ -986,7 +886,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_PERF_EVENTS { - .ctl_name = CTL_UNNUMBERED, .procname = "perf_event_paranoid", .data = &sysctl_perf_event_paranoid, .maxlen = sizeof(sysctl_perf_event_paranoid),
@@ -994,7 +893,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "perf_event_mlock_kb", .data = &sysctl_perf_event_mlock, .maxlen = sizeof(sysctl_perf_event_mlock),
@@ -1002,7 +900,6 @@ static struct ctl_table kern_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "perf_event_max_sample_rate", .data = &sysctl_perf_event_sample_rate, .maxlen = sizeof(sysctl_perf_event_sample_rate),
@@ -1012,7 +909,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_KMEMCHECK { - .ctl_name = CTL_UNNUMBERED, .procname = "kmemcheck", .data = &kmemcheck_enabled, .maxlen = sizeof(int),
@@ -1022,7 +918,6 @@ static struct ctl_table kern_table[] = {#endif #ifdef CONFIG_BLOCK { - .ctl_name = CTL_UNNUMBERED, .procname = "blk_iopoll", .data = &blk_iopoll_enabled, .maxlen = sizeof(int),
@@ -1034,12 +929,11 @@ static struct ctl_table kern_table[] = {* NOTE: do not add new entries to this table unless you have read * Documentation/sysctl/ctl_unnumbered.txt */ - { .ctl_name = 0 } + { } };static struct ctl_table vm_table[] = { { - .ctl_name =VM_OVERCOMMIT_MEMORY , .procname ="overcommit_memory" , .data = &sysctl_overcommit_memory, .maxlen =sizeof (sysctl_overcommit_memory),
@@ -1047,7 +941,6 @@ static struct ctl_table vm_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = VM_PANIC_ON_OOM, .procname = "panic_on_oom", .data = &sysctl_panic_on_oom, .maxlen = sizeof(sysctl_panic_on_oom),
@@ -1055,7 +948,6 @@ static struct ctl_table vm_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "oom_kill_allocating_task", .data = &sysctl_oom_kill_allocating_task, .maxlen = sizeof(sysctl_oom_kill_allocating_task),
@@ -1063,7 +955,6 @@ static struct ctl_table vm_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "oom_dump_tasks", .data = &sysctl_oom_dump_tasks, .maxlen = sizeof(sysctl_oom_dump_tasks),
@@ -1071,7 +962,6 @@ static struct ctl_table vm_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = VM_OVERCOMMIT_RATIO, .procname = "overcommit_ratio", .data = &sysctl_overcommit_ratio, .maxlen = sizeof(sysctl_overcommit_ratio),
@@ -1079,7 +969,6 @@ static struct ctl_table vm_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = VM_PAGE_CLUSTER, .procname = "page-cluster", .data = &page_cluster, .maxlen = sizeof(int),
@@ -1087,45 +976,37 @@ static struct ctl_table vm_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = VM_DIRTY_BACKGROUND, .procname = "dirty_background_ratio", .data = &dirty_background_ratio, .maxlen = sizeof(dirty_background_ratio), .mode = 0644, .proc_handler = &dirty_background_ratio_handler, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &one_hundred, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "dirty_background_bytes", .data = &dirty_background_bytes, .maxlen = sizeof(dirty_background_bytes), .mode = 0644, .proc_handler = &dirty_background_bytes_handler, - .strategy = &sysctl_intvec, .extra1 = &one_ul, }, { - .ctl_name = VM_DIRTY_RATIO, .procname = "dirty_ratio", .data = &vm_dirty_ratio, .maxlen = sizeof(vm_dirty_ratio), .mode = 0644, .proc_handler = &dirty_ratio_handler, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &one_hundred, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "dirty_bytes", .data = &vm_dirty_bytes, .maxlen = sizeof(vm_dirty_bytes), .mode = 0644, .proc_handler = &dirty_bytes_handler, - .strategy = &sysctl_intvec, .extra1 = &dirty_bytes_min, }, {
@@ -1143,7 +1024,6 @@ static struct ctl_table vm_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = VM_NR_PDFLUSH_THREADS, .procname = "nr_pdflush_threads", .data = &nr_pdflush_threads, .maxlen = sizeof nr_pdflush_threads,
@@ -1151,13 +1031,11 @@ static struct ctl_table vm_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = VM_SWAPPINESS, .procname = "swappiness", .data = &vm_swappiness, .maxlen = sizeof(vm_swappiness), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &one_hundred, },
@@ -1172,7 +1050,6 @@ static struct ctl_table vm_table[] = { .extra2 = (void *)&hugetlb_infinity, }, { - .ctl_name = VM_HUGETLB_GROUP, .procname = "hugetlb_shm_group", .data = &sysctl_hugetlb_shm_group, .maxlen = sizeof(gid_t),
@@ -1180,7 +1057,6 @@ static struct ctl_table vm_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "hugepages_treat_as_movable", .data = &hugepages_treat_as_movable, .maxlen = sizeof(int),
@@ -1188,7 +1064,6 @@ static struct ctl_table vm_table[] = { .proc_handler = &hugetlb_treat_movable_handler, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "nr_overcommit_hugepages", .data = NULL, .maxlen = sizeof(unsigned long),
@@ -1199,46 +1074,37 @@ static struct ctl_table vm_table[] = { },#endif { - .ctl_name = VM_LOWMEM_RESERVE_RATIO, .procname = "lowmem_reserve_ratio", .data = &sysctl_lowmem_reserve_ratio, .maxlen = sizeof(sysctl_lowmem_reserve_ratio), .mode = 0644, .proc_handler = &lowmem_reserve_ratio_sysctl_handler, - .strategy = &sysctl_intvec, }, { - .ctl_name = VM_DROP_PAGECACHE, .procname = "drop_caches", .data = &sysctl_drop_caches, .maxlen = sizeof(int), .mode = 0644, .proc_handler = drop_caches_sysctl_handler, - .strategy = &sysctl_intvec, }, { - .ctl_name = VM_MIN_FREE_KBYTES, .procname = "min_free_kbytes", .data = &min_free_kbytes, .maxlen = sizeof(min_free_kbytes), .mode = 0644, .proc_handler = &min_free_kbytes_sysctl_handler, - .strategy = &sysctl_intvec, .extra1 = &zero, }, { - .ctl_name = VM_PERCPU_PAGELIST_FRACTION, .procname = "percpu_pagelist_fraction", .data = &percpu_pagelist_fraction, .maxlen = sizeof(percpu_pagelist_fraction), .mode = 0644, .proc_handler = &percpu_pagelist_fraction_sysctl_handler, - .strategy = &sysctl_intvec, .extra1 = &min_percpu_pagelist_fract, }, #ifdef CONFIG_MMU { - .ctl_name =VM_MAX_MAP_COUNT , .procname = "max_map_count", .data = &sysctl_max_map_count, .maxlen = sizeof(sysctl_max_map_count),
@@ -1247,104 +1113,85 @@ static struct ctl_table vm_table[] = { }, #else { - .ctl_name = CTL_UNNUMBERED, .procname = "nr_trim_pages", .data = &sysctl_nr_trim_pages, .maxlen = sizeof(sysctl_nr_trim_pages), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, }, #endif { - .ctl_name = VM_LAPTOP_MODE, .procname = "laptop_mode", .data = &laptop_mode, .maxlen = sizeof(laptop_mode), .mode = 0644, .proc_handler = &proc_dointvec_jiffies, - .strategy = &sysctl_jiffies, }, { - .ctl_name = VM_BLOCK_DUMP, .procname = "block_dump", .data = &block_dump, .maxlen = sizeof(block_dump), .mode = 0644, .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec, .extra1 = &zero, }, { - .ctl_name = VM_VFS_CACHE_PRESSURE, .procname = "vfs_cache_pressure", .data = &sysctl_vfs_cache_pressure, .maxlen = sizeof(sysctl_vfs_cache_pressure), .mode = 0644, .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec, .extra1 = &zero, }, #ifdef HAVE_ARCH_PICK_MMAP_LAYOUT { - .ctl_name =VM_LEGACY_VA_LAYOUT , .procname = "legacy_va_layout", .data = &sysctl_legacy_va_layout, .maxlen = sizeof(sysctl_legacy_va_layout), .mode = 0644, .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec, .extra1 = &zero, }, #endif #ifdef CONFIG_NUMA { - .ctl_name =VM_ZONE_RECLAIM_MODE , .procname = "zone_reclaim_mode", .data = &zone_reclaim_mode, .maxlen = sizeof(zone_reclaim_mode), .mode = 0644, .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec, .extra1 = &zero, }, { - .ctl_name =VM_MIN_UNMAPPED , .procname = "min_unmapped_ratio", .data = &sysctl_min_unmapped_ratio, .maxlen = sizeof(sysctl_min_unmapped_ratio), .mode = 0644, .proc_handler = &sysctl_min_unmapped_ratio_sysctl_handler, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &one_hundred, }, { - .ctl_name =VM_MIN_SLAB , .procname = "min_slab_ratio", .data = &sysctl_min_slab_ratio, .maxlen = sizeof(sysctl_min_slab_ratio), .mode = 0644, .proc_handler = &sysctl_min_slab_ratio_sysctl_handler, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &one_hundred, }, #endif #ifdef CONFIG_SMP { - .ctl_name =CTL_UNNUMBERED , .procname = "stat_interval", .data = &sysctl_stat_interval, .maxlen = sizeof(sysctl_stat_interval), .mode = 0644, .proc_handler = &proc_dointvec_jiffies, - .strategy = &sysctl_jiffies, }, #endif { - .ctl_name =CTL_UNNUMBERED , .procname = "mmap_min_addr", .data = &dac_mmap_min_addr, .maxlen = sizeof(unsigned long),
@@ -1353,43 +1200,36 @@ static struct ctl_table vm_table[] = { }, #ifdef CONFIG_NUMA { - .ctl_name = CTL_UNNUMBERED, .procname = "numa_zonelist_order", .data = &numa_zonelist_order, .maxlen = NUMA_ZONELIST_ORDER_LEN, .mode = 0644, .proc_handler = &numa_zonelist_order_handler, - .strategy = &sysctl_string, }, #endif #if (defined(CONFIG_X86_32) && !defined(CONFIG_UML))|| \ (defined(CONFIG_SUPERH) && defined(CONFIG_VSYSCALL)) { - .ctl_name = VM_VDSO_ENABLED, .procname = "vdso_enabled", .data = &vdso_enabled, .maxlen = sizeof(vdso_enabled), .mode = 0644, .proc_handler = &proc_dointvec, - .strategy = &sysctl_intvec, .extra1 = &zero, }, #endif #ifdef CONFIG_HIGHMEM { - .ctl_name = CTL_UNNUMBERED, .procname = "highmem_is_dirtyable", .data = &vm_highmem_is_dirtyable, .maxlen = sizeof(vm_highmem_is_dirtyable), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &one, }, #endif { - .ctl_name = CTL_UNNUMBERED, .procname = "scan_unevictable_pages", .data = &scan_unevictable_pages, .maxlen = sizeof(scan_unevictable_pages),
@@ -1398,24 +1238,20 @@ static struct ctl_table vm_table[] = { }, #ifdef CONFIG_MEMORY_FAILURE { - .ctl_name = CTL_UNNUMBERED, .procname = "memory_failure_early_kill", .data = &sysctl_memory_failure_early_kill, .maxlen = sizeof(sysctl_memory_failure_early_kill), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &one, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "memory_failure_recovery", .data = &sysctl_memory_failure_recovery, .maxlen = sizeof(sysctl_memory_failure_recovery), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &one, },
@@ -1425,18 +1261,17 @@ static struct ctl_table vm_table[] = {* NOTE: do not add new entries to this table unless you have read * Documentation/sysctl/ctl_unnumbered.txt */ - { .ctl_name = 0 } + { } };#if defined(CONFIG_BINFMT_MISC ) || defined(CONFIG_BINFMT_MISC_MODULE )static struct ctl_table binfmt_misc_table[] = { - { .ctl_name =0 } + { } };#endif static struct ctl_table fs_table[] = { { - .ctl_name =FS_NRINODE , .procname ="inode-nr" , .data = &inodes_stat, .maxlen =2 *sizeof (int ),
@@ -1444,7 +1279,6 @@ static struct ctl_table fs_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = FS_STATINODE, .procname = "inode-state", .data = &inodes_stat, .maxlen = 7*sizeof(int),
@@ -1459,7 +1293,6 @@ static struct ctl_table fs_table[] = { .proc_handler = &proc_nr_files, }, { - .ctl_name = FS_MAXFILE, .procname = "file-max", .data = &files_stat.max_files, .maxlen = sizeof(int),
@@ -1467,7 +1300,6 @@ static struct ctl_table fs_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = CTL_UNNUMBERED, .procname = "nr_open", .data = &sysctl_nr_open, .maxlen = sizeof(int),
@@ -1477,7 +1309,6 @@ static struct ctl_table fs_table[] = { .extra2 = &sysctl_nr_open_max, }, { - .ctl_name = FS_DENTRY, .procname = "dentry-state", .data = &dentry_stat, .maxlen = 6*sizeof(int),
@@ -1485,30 +1316,25 @@ static struct ctl_table fs_table[] = { .proc_handler = &proc_dointvec, }, { - .ctl_name = FS_OVERFLOWUID, .procname = "overflowuid", .data = &fs_overflowuid, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &minolduid, .extra2 = &maxolduid, }, { - .ctl_name = FS_OVERFLOWGID, .procname = "overflowgid", .data = &fs_overflowgid, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &minolduid, .extra2 = &maxolduid, }, #ifdef CONFIG_FILE_LOCKING { - .ctl_name =FS_LEASES , .procname = "leases-enable", .data = &leases_enable, .maxlen = sizeof(int),
@@ -1518,7 +1344,6 @@ static struct ctl_table fs_table[] = {#endif #ifdef CONFIG_DNOTIFY { - .ctl_name = FS_DIR_NOTIFY, .procname = "dir-notify-enable", .data = &dir_notify_enable, .maxlen = sizeof(int),
@@ -1529,7 +1354,6 @@ static struct ctl_table fs_table[] = { #ifdef CONFIG_MMU #ifdef CONFIG_FILE_LOCKING { - .ctl_name = FS_LEASE_TIME, .procname = "lease-break-time", .data = &lease_break_time, .maxlen = sizeof(int),
@@ -1555,7 +1379,6 @@ static struct ctl_table fs_table[] = {#endif /* CONFIG_AIO */ #ifdef CONFIG_INOTIFY_USER { - .ctl_name = FS_INOTIFY, .procname = "inotify", .mode = 0555, .child = inotify_table,
@@ -1570,19 +1393,16 @@ static struct ctl_table fs_table[] = {#endif #endif { - .ctl_name = KERN_SETUID_DUMPABLE, .procname = "suid_dumpable", .data = &suid_dumpable, .maxlen = sizeof(int), .mode = 0644, .proc_handler = &proc_dointvec_minmax, - .strategy = &sysctl_intvec, .extra1 = &zero, .extra2 = &two, },#if defined(CONFIG_BINFMT_MISC ) || defined(CONFIG_BINFMT_MISC_MODULE ) { - .ctl_name = CTL_UNNUMBERED, .procname = "binfmt_misc", .mode = 0555, .child = binfmt_misc_table,
@@ -1592,13 +1412,12 @@ static struct ctl_table fs_table[] = {* NOTE: do not add new entries to this table unless you have read * Documentation/sysctl/ctl_unnumbered.txt */ - { .ctl_name = 0 } + { } }; static struct ctl_table debug_table[] = { #if defined(CONFIG_X86) || defined(CONFIG_PPC) { - .ctl_name = CTL_UNNUMBERED, .procname = "exception-trace", .data = &show_unhandled_signals, .maxlen = sizeof(int),
@@ -1606,11 +1425,11 @@ static struct ctl_table debug_table[] = { .proc_handler = proc_dointvec },#endif - { .ctl_name = 0 } + { } };static struct ctl_table dev_table[] = { - { .ctl_name =0 } + { } };static DEFINE_SPINLOCK (sysctl_lock);
Signature · 1 line
1.6.5.2.143.g8cc62
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Eric W. BiedermanQuoted 45 lines · Eric W. Biederman
arch/arm/kernel/isa.c +2
-6@@ -22,47 +22,42 @@ static unsigned int isa_membase, isa_portbase, isa_portshift;static ctl_table ctl_isa_vars[4 ] = { { - .ctl_name =BUS_ISA_MEM_BASE , .procname ="membase" , .data = &isa_membase, .maxlen =sizeof (isa_membase), .mode =0444 , .proc_handler = &proc_dointvec, }, { - .ctl_name =BUS_ISA_PORT_BASE , .procname ="portbase" , .data = &isa_portbase, .maxlen =sizeof (isa_portbase), .mode =0444 , .proc_handler = &proc_dointvec, }, { - .ctl_name =BUS_ISA_PORT_SHIFT , .procname ="portshift" , .data = &isa_portshift, .maxlen =sizeof (isa_portshift), .mode =0444 , .proc_handler = &proc_dointvec, - }, {0 } + }, {} };static struct ctl_table_header *isa_sysctl_header;static ctl_table ctl_isa[2 ] = { { - .ctl_name =CTL_BUS_ISA , .procname ="isa" , .mode =0555 , .child = ctl_isa_vars, - }, {0 } + }, {} };static ctl_table ctl_bus[2 ] = {
arch/arm/kernel/isa.c static unsigned int isa_membase, isa_portbase, isa_portshift; · line 63
Quoted 10 lines
arch/arm/kernel/isa.c +1
-2{ - .ctl_name = CTL_BUS, .procname = "bus", .mode = 0555, .child = ctl_isa, - }, {0} + }, {} };void __init
NAK. Glibc uses these numeric sysctls to support ioperm emulation on ARM. Therefore, removal of these numeric sysctls breaks that user interface:
static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE }; static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT }; if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
&& ! sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0))
{
io.initdone = 1;
return 0;
}...
Quoted 24 lines
arch/arm/mach-bcmring/arch.c +0
-5@@ -47,10 +47,6 @@ HW_DECLARE_SPINLOCK(gpio)EXPORT_SYMBOL (bcmring_gpio_reg_lock);#endif -/* FIXME: temporary solution */ -#define BCM_SYSCTL_REBOOT_WARM 1 -#define CTL_BCM_REBOOT 112 -/* sysctl */ int bcmring_arch_warm_reboot;/* do a warm reboot on hard reset */ @@ -58,7 +54,6 @@ static struct ctl_table_header *bcmring_sysctl_header;static struct ctl_table bcmring_sysctl_warm_reboot[] = { { - .ctl_name =BCM_SYSCTL_REBOOT_WARM , .procname ="warm" , .data = &bcmring_arch_warm_reboot, .maxlen =sizeof (int ),
arch/arm/mach-bcmring/arch.c static struct ctl_table bcmring_sysctl_warm_reboot[] = { · line 69
Quoted 7 lines
arch/arm/mach-bcmring/arch.c +0
-1@@ -69,7 +64,6 @@ static struct ctl_table bcmring_sysctl_warm_reboot[] = {static struct ctl_table bcmring_sysctl_reboot[] = { { - .ctl_name =CTL_BCM_REBOOT , .procname ="reboot" , .mode =0555 , .child = bcmring_sysctl_warm_reboot},
Ack for this part.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
Arnd Bergmann
maintainerQuoted 8 lines · On Sunday 08 November 2009 12:16:43 Eric W. Biederman wrote:
This patchset reimplements
sys_sysctlas a compatibility wrapper around/proc/sys. After which it removes all of the code to all over the kernel that is used today to implement the binary sysctls.I am posting this patchset to give everyone a heads up what is in flight.
I intend to carry all of these patches in my sysctl tree.
Very nice patches again!
Looking at what you did, I had two ideas how to move on from there, which may be part of your plans already:
1. Make it possible to build sysctl_binary.c as a loadable module so you can get a smaller kernel without losing the option to use binary sysctl altogether. This of course requires a small portion to remain in the kernel, to provide the actual syscall entry point and load the module on demand.
2. On top of that, put the same code into glibc so that you don't even have to load the module when you're running a new glibc version. Since the binary sysctl ABI is stable (as in stiff and dead), there should be no need to synchronize any extensions to it betwen kernel and libc.
Arnd <><
Re: [PATCH 13/23] sysctl crypto: Remove dead binary sysctl support
In reply to Eric W. BiedermanQuoted 7 lines · Eric W. Biederman
From: Eric W. Biederman <[email protected]>
Now that
sys_sysctlis a generic wrapper around/proc/sys.ctl_name and .strategy members of sysctl tables are dead code. Remove them.Cc Herbert Xu <[email protected]>Signed-off-by Eric W. Biederman <[email protected]>
Signature · 4 lines
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txtRe: [PATCH 19/23] sysctl powerpc: Remove dead binary sysctl support
In reply to Eric W. BiedermanQuoted 5 lines · Eric W. Biederman
From: Eric W. Biederman <[email protected]>
Now that
sys_sysctlis a generic wrapper around/proc/sys.ctl_name and .strategy members of sysctl tables are dead code. Remove them.
Quoted 26 lines
Cc Paul Mackerras <[email protected]>Signed-off-by Eric W. Biederman <[email protected]>--- arch/powerpc/kernel/idle.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)arch/powerpc/kernel/idle.c +0
-2@@ -110,7 +110,6 @@ int powersave_nap;*/ static ctl_table powersave_nap_ctl_table[]={ { - .ctl_name =KERN_PPC_POWERSAVE_NAP , .procname ="powersave-nap" , .data = &powersave_nap, .maxlen =sizeof (int ),@@ -121,7 +120,6 @@ static ctl_table powersave_nap_ctl_table[]={ };static ctl_table powersave_nap_sysctl_root[] = { { - .ctl_name =CTL_KERN , .procname ="kernel" , .mode =0555 , .child = powersave_nap_ctl_table,
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Russell KingQuoted 4 lines · Russell King
NAK. Glibc uses these numeric sysctls to support ioperm emulation on ARM. Therefore, removal of these numeric sysctls breaks that user interface:
Quoted 8 lines
static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)
&& ! sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0))
{
io.initdone = 1;
return 0;
}Those still exist in sysctl_binary.c are provided by reading /proc/sys/bus/isa/membase, /proc/sys/bus/isa/portbase, and /proc/sys/bus/isa/portshift.
The practical difference is that /proc support now must be compiled in to support sys_sysctl.
Eric
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
Quoted 15 lines · Eric W. Biederman
Quoted 4 lines · Russell King
NAK. Glibc uses these numeric sysctls to support ioperm emulation on ARM. Therefore, removal of these numeric sysctls breaks that user interface:
Quoted 8 lines
static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE }; static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT }; if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0) && ! sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0)) { io.initdone = 1; return 0; }
Quoted 6 lines
Those still exist in
sysctl_binary.care provided by reading/proc/sys/bus/isa/membase,/proc/sys/bus/isa/portbase, and/proc/sys/bus/isa/portshift.The practical difference is that /proc support now must be compiled in to support
sys_sysctl.
Have you checked whether glibc supports reading these from procfs rather than sysfs using the code as it stands above?
If not, continued NAK due to user visible ABI change which will cause breakage.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Eric W. BiedermanQuoted 15 lines · [email protected] (Eric W. Biederman) writes:
Quoted 4 lines · Russell King
NAK. Glibc uses these numeric sysctls to support ioperm emulation on ARM. Therefore, removal of these numeric sysctls breaks that user interface:
Quoted 8 lines
static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE }; static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT }; if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0) && ! sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0)) { io.initdone = 1; return 0; }
Quoted 6 lines
Those still exist in
sysctl_binary.care provided by reading/proc/sys/bus/isa/membase,/proc/sys/bus/isa/portbase, and/proc/sys/bus/isa/portshift.The practical difference is that /proc support now must be compiled in to support
sys_sysctl.
But thanks for the reminder that I need to go into glibc and fix this before we disable the sys_sysctl emulation by default.
Eric
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Russell KingQuoted 20 lines · Russell King
Quoted 19 lines · Eric W. Biederman
Quoted 4 lines · Russell King
NAK. Glibc uses these numeric sysctls to support ioperm emulation on ARM. Therefore, removal of these numeric sysctls breaks that user interface:
Quoted 8 lines
static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE }; static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT }; if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0) && ! sysctl (ioshift_name, 3, &io.shift, &len, NULL, 0)) { io.initdone = 1; return 0; }Those still exist in
sysctl_binary.care provided by reading/proc/sys/bus/isa/membase,/proc/sys/bus/isa/portbase, and/proc/sys/bus/isa/portshift.
Quoted 8 lines
Quoted 2 lines
The practical difference is that /proc support now must be compiled in to support
sys_sysctl.Have you checked whether glibc supports reading these from procfs rather than sysfs using the code as it stands above?
If not, continued NAK due to user visible ABI change which will cause breakage.
There is not a user visible ABI change. Just a massive implementation change. The only user visible change is that CONFIG_SYS_SYSCALL now depends on CONFIG_PROC_SYSCTL.
The implementation of sys_sysctl in binary_sysctl.c will now read /proc/sys/bus/isa/portbase and using vfs_read convert the text string to a binary integer and return it to glibc in the form sys_sysctl has always used.
And yes, as of glibc-ports-10.1 the arm implementation of ioperm still depends on the binary sys_sysctl implementation to get this information.
Eric
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
Quoted 8 lines · Eric W. Biederman
There is not a user visible ABI change. Just a massive implementation change. The only user visible change is that
CONFIG_SYS_SYSCALLnow depends onCONFIG_PROC_SYSCTL.The implementation of
sys_sysctlinbinary_sysctl.cwill now read/proc/sys/bus/isa/portbaseand usingvfs_readconvert the text string to a binary integer and return it to glibc in the formsys_sysctlhas always used.
Right, that information was missing from the original patch. No problem then.
Signature · 3 lines
Russell King Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/ maintainer of:
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Eric W. BiedermanQuoted 6 lines · On Sun, 08 Nov 2009 15:05:05 -0800 [email protected] (Eric W. Biederman)…
Quoted 3 lines
The practical difference is that /proc support now must be compiled in to support
sys_sysctl.But thanks for the reminder that I need to go into glibc and fix this before we disable the
sys_sysctlemulation by default.
how are you dealing with existing glibcs ? Or with static linked binaries? or.. or ..
breaking a heavily used ABI like this is not going to be pretty or even sane, no matter which way you hate the current one.
Signature · 3 lines
Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
Quoted 7 lines · Arjan van de Ven
Quoted 4 lines · On Sun, 08 Nov 2009 15:05:05 -0800 [email protected] (Eric W. Biederman)…
Quoted 3 lines
The practical difference is that /proc support now must be compiled in to support
sys_sysctl.
Quoted 8 lines
Quoted 2 lines
But thanks for the reminder that I need to go into glibc and fix this before we disable the
sys_sysctlemulation by default.how are you dealing with existing glibcs ? Or with static linked binaries? or.. or ..
breaking a heavily used ABI like this is not going to be pretty or even sane, no matter which way you hate the current one.
sysctl_binary.c has all of the code to continue to provide the existing ABI.
sys_sysctl is not heavily used at all, and this is the responsible removal of a practically unused ABI. Last I check (and this was before I shouted to the world that sys_sysctl is going away) I could count on one hand all of the users of sys_sysctl.
/proc/sys will definitely continue to exist.
I just took a look and the use in linux threads that I don't warn about is used by glibc-2.8 but not by glibc-2.10. glibc-2.11 has just been released. so by next year when the removal is scheduled we are looking at multiple releases of glibc that don't use sys_sysctl. So I expect shortly I can warn about all uses of sys_sysctl without anyone seeing a warning.
The one unfixed case I know about is fixing ioperm on arm, in the glibc ports tree, and that will need to happen before sys_sysctl is disabled by default. Which is all I intend to do when we reach that point in feature removal schedule now that I have refactored the code so that sys_sysctl no longer imposes a maintenance burden on the sane sysctl users.
I don't hate sysctl, in fact for global tuneables I would argue for all it's faults sysctl it is one of the better interfaces we have. I just figure the implementation needs to be optimized for the way sysctl is used today, the via /proc/sys.
Eric
Quoted 12 lines · Arnd Bergmann
Quoted 8 lines · On Sunday 08 November 2009 12:16:43 Eric W. Biederman wrote:
This patchset reimplements
sys_sysctlas a compatibility wrapper around/proc/sys. After which it removes all of the code to all over the kernel that is used today to implement the binary sysctls.I am posting this patchset to give everyone a heads up what is in flight.
I intend to carry all of these patches in my sysctl tree.
Very nice patches again!
Quoted 8 lines
Looking at what you did, I had two ideas how to move on from there, which may be part of your plans already:
1. Make it possible to build
sysctl_binary.cas a loadable module so you can get a smaller kernel without losing the option to use binary sysctl altogether. This of course requires a small portion to remain in the kernel, to provide the actual syscall entry point and load the module on demand.
I can see how this could make sense from a distribution perspective.
Quoted 5 lines
2. On top of that, put the same code into glibc so that you don't even have to load the module when you're running a new glibc version. Since the binary sysctl ABI is stable (as in stiff and dead), there should be no need to synchronize any extensions to it betwen kernel and libc.
I don't expect we will need to move this to glibc. There are so few users of sys_sysctl now, that I hardly expect it to be worth it to move this code out of the kernel.
For me the big problem with sys_sysctl is solved by this patchset. It no longer constitutes a maintenance burden on the rest of the sysctl code, and the other sysctl users.
Now the implementation of /proc/sys can be implemented and optimized without dealing with any sys_sysctl baggage.
All of that said if someone is interested in tweaking sysctl_binary.c to make it easier to deal with sys_sysctl going away I don't have any problems.
Eric
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Eric W. BiedermanQuoted 6 lines · On Sun, 08 Nov 2009 19:27:07 -0800 [email protected] (Eric W. Biederman)…
I just took a look and the use in linux threads that I don't warn about is used by glibc-2.8 but not by glibc-2.10. glibc-2.11 has just been released. so by next year when the removal is scheduled we are looking at multiple releases of glibc that don't use
sys_sysctl. So I expect shortly I can warn about all uses ofsys_sysctlwithout anyone seeing a warning.
hmmmmm it's still an ABI break, and while you say "oh it's 3 glibcs ago".. there's the static linking case.
to be honest, I don't think we can ever remove things that are used by glibc during its startup....
Signature · 3 lines
Arjan van de Ven Intel Open Source Technology Centre For development, discussion and tips for power savings, visit http://www.lesswatts.org
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
Quoted 10 lines · Arjan van de Ven
Quoted 6 lines · On Sun, 08 Nov 2009 19:27:07 -0800 [email protected] (Eric W. Biederman)…
I just took a look and the use in linux threads that I don't warn about is used by glibc-2.8 but not by glibc-2.10. glibc-2.11 has just been released. so by next year when the removal is scheduled we are looking at multiple releases of glibc that don't use
sys_sysctl. So I expect shortly I can warn about all uses ofsys_sysctlwithout anyone seeing a warning.
Quoted 5 lines
hmmmmm it's still an ABI break, and while you say "oh it's 3 glibcs ago".. there's the static linking case.
to be honest, I don't think we can ever remove things that are used by glibc during its startup....
The glibc pthread code that uses sysctl has no problems if sys_sysctl is gone. It both falls back to reading /proc/sys and it just controls an optimization and the code works with either result. Been there, done that.
The only reason sys_sysctl remains is because there are a handful of other apps that needed an appropriate warning time, and we weren't doing anything that had a reasonable chance of notifying them.
I think it is worth getting us to the point where we can run with sysctl disabled. At the same time, this patchset gets 99%+ of the benefit. It isolates the entire binary interface into sysctl_binary.c so outside of that one file we have no maintenance overhead in maintaining the binary interface, and anyone who is trying to optimize for kernel size can trivially turn it off.
Which allows the kernel development to proceed as if the sysctl binary interface does not exist, as it has largely always done.
Eric
Re: [PATCH 14/23] sysctl drivers: Remove dead binary sysctl support
In reply to Eric W. BiedermanQuoted 5 lines · Eric W. Biederman
Now that
sys_sysctlis a wrapper around/proc/sysall of the binary sysctl support elsewhere in the tree is dead code.Cc Clemens Ladisch <[email protected]>
for this:
Quoted 1 line
drivers/char/hpet.c | 9 ++-----
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Eric W. BiedermanQuoted 5 lines · [email protected] (Eric W. Biederman) writes:
The glibc pthread code that uses sysctl has no problems if
sys_sysctlis gone. It both falls back to reading/proc/sysand it just controls an optimization and the code works with either result. Been there, done that.
/proc/sys is much slower than sysctl though. So you made program startup slower.
Also I agree with Arjan that breaking such a common ABI is not really a good idea. But I think it's enough to only handle common sysctls that are actually used, which are very few.
It would be better to simply keep the commonly used binary sysctls as emulation around always (commonly = used by glibc and perhaps added by user printk feedback) That's very cheap because it's just a simple translation and can be done internally cheaper than going through the VFS with a bazillion of locks.
-Andi
Signature · 1 line
[email protected] -- Speaking for myself only.
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
Quoted 9 lines · Andi Kleen
Quoted 5 lines · [email protected] (Eric W. Biederman) writes:
The glibc pthread code that uses sysctl has no problems if
sys_sysctlis gone. It both falls back to reading/proc/sysand it just controls an optimization and the code works with either result. Been there, done that.
/proc/sysis much slower than sysctl though. So you made program startup slower.
Not much slower, but slower. I just measured it in a case that favors sysctl and the ration is about 5:2. Or sysctl is about 2.5x faster. About 49usec for open/read/close on proc and 19usec for sysctl. In my emulation it is a bit slower than that.
Quoted 3 lines
Also I agree with Arjan that breaking such a common ABI is not really a good idea. But I think it's enough to only handle common sysctls that are actually used, which are very few.
Well I haven't broken anything at this point. I am simply edging us to the point when we are close to being able to forget about sys_sysctl for good.
As for the rest the common number of sysctls with glibc > 2.8 is exactly 0. Which makes compiling out sys_sysctl support sane. Especially since we have been throwing a warning for years if anyone uses any of the others.
Quoted 5 lines
It would be better to simply keep the commonly used binary sysctls as emulation around always (commonly = used by glibc and perhaps added by user printk feedback) That's very cheap because it's just a simple translation and can be done internally cheaper than going through the VFS with a bazillion of locks.
A micro optimization for code that does not exist. That is a bad trade off.
Further it is my intention to optimize /proc/sys when I get the chance now that we don't have all of the old sysctl baggage holding back the code.
I don't see anything that makes the date in Documentation/feature-removal-schedule.txt of September 2010 unrealistic.
Ultimately what drives me most is that people are still accidentally adding binary sysctls, which no one uses or tests. For a recent example see:
Quoted 11 lines
commit
4663712cc745324a216112a72c744bb2b8f6658bAuthor: Leo Chen <[email protected]> Date: Fri Aug 7 19:56:19 2009 +0100ARM: 5643/1: bcmring:
arch.cand header filesadd
arch.cin mach-bcmring
add related header files in mach-bcmringSigned-off-by Leo Chen <[email protected]>Signed-off-by Russell King <[email protected]>
Andi if you want to do the do the legwork and optimize sysctl_binary.c so it does a better job, for that one sysctl older glibc's use, feel free to write the code.
I don't care enough, and I expect to upgrade to a glibc without the a single sysctl call before it would possibly matter to me.
Eric
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
Quoted 9 lines · Eric W. Biederman
Quoted 7 lines · Andi Kleen
Quoted 5 lines · [email protected] (Eric W. Biederman) writes:
The glibc pthread code that uses sysctl has no problems if
sys_sysctlis gone. It both falls back to reading/proc/sysand it just controls an optimization and the code works with either result. Been there, done that.
Quoted 7 lines
Quoted 2 lines
/proc/sysis much slower than sysctl though. So you made program startup slower.Not much slower, but slower. I just measured it in a case that favors sysctl and the ration is about 5:2. Or sysctl is about 2.5x faster. About 49usec for open/read/close on proc and 19usec for sysctl. In my emulation it is a bit slower than that.
That's not good.
Quoted 8 lines
Quoted 4 lines
Also I agree with Arjan that breaking such a common ABI is not really a good idea. But I think it's enough to only handle common sysctls that are actually used, which are very few.
Well I haven't broken anything at this point. I am simply edging us to the point when we are close to being able to forget about
sys_sysctlfor good.
I think all-or-nothing that you have right now is a bad trade-off because it breaks an established interface used by lots of code (glibc)
You should have three states
a) all
b) common ones used by glibc and perhaps a few others only
c) none
I suspect most users would use (b), in fact (c) might be redundant if (b) is cheap enough (which it should be)
Quoted 4 lines
As for the rest the common number of sysctls with glibc > 2.8 is exactly 0. Which makes compiling out
sys_sysctlsupport sane. Especially since we have been throwing a warning for years if anyone uses any of the others.
Yes, but people ignore the warning. Perhaps should make it a WARN() and track it with kernelops?
Quoted 9 lines
Quoted 6 lines
It would be better to simply keep the commonly used binary sysctls as emulation around always (commonly = used by glibc and perhaps added by user printk feedback) That's very cheap because it's just a simple translation and can be done internally cheaper than going through the VFS with a bazillion of locks.
A micro optimization for code that does not exist. That is a bad trade off.
Hmm? There's plenty of glibc code that uses the binary sysctl.
Quoted 3 lines
Further it is my intention to optimize
/proc/syswhen I get the chance now that we don't have all of the old sysctl baggage holding back the code.
The VFS will always be comparably slow I suspect; I'm not sure you can optimize it that much compared to a fast custom path (especially handling the kernel version should be really fast)
Quoted 3 lines
Ultimately what drives me most is that people are still accidentally adding binary sysctls, which no one uses or tests. For a recent example see:
Yes I agree new binary sysctls should just be deprecated right now.
-Andi
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
Quoted 13 lines · Andi Kleen
Quoted 12 lines · Eric W. Biederman
Quoted 9 lines · Andi Kleen
Quoted 5 lines · [email protected] (Eric W. Biederman) writes:
The glibc pthread code that uses sysctl has no problems if
sys_sysctlis gone. It both falls back to reading/proc/sysand it just controls an optimization and the code works with either result. Been there, done that.
/proc/sysis much slower than sysctl though. So you made program startup slower.
Quoted 6 lines
Quoted 4 lines
Not much slower, but slower. I just measured it in a case that favors sysctl and the ration is about 5:2. Or sysctl is about 2.5x faster. About 49usec for open/read/close on proc and 19usec for sysctl. In my emulation it is a bit slower than that.
That's not good.
Why?
Quoted 11 lines
Quoted 7 lines
Quoted 3 lines
Also I agree with Arjan that breaking such a common ABI is not really a good idea. But I think it's enough to only handle common sysctls that are actually used, which are very few.
Well I haven't broken anything at this point. I am simply edging us to the point when we are close to being able to forget about
sys_sysctlfor good.I think all-or-nothing that you have right now is a bad trade-off because it breaks an established interface used by lots of code (glibc)
Quoted 8 lines
You should have three states
a) all
b) common ones used by glibc and perhaps a few others only
c) noneI suspect most users would use (b), in fact (c) might be redundant if (b) is cheap enough (which it should be)
Next year I expect b == c.
If you think we need something better additional patches to sysctl_binary.c are welcome. Just add your custom fast path before the through the VFS.
Quoted 7 lines
Quoted 4 lines
As for the rest the common number of sysctls with glibc > 2.8 is exactly 0. Which makes compiling out
sys_sysctlsupport sane. Especially since we have been throwing a warning for years if anyone uses any of the others.Yes, but people ignore the warning. Perhaps should make it a
WARN()and track it with kernelops?
When I have googled for it I have seen applications getting fixed.
Regardless if the warning was there for them to ignore they have been warned. With my patches the maintenance overhead in the core kernel is low enough I don't think it matters. Unless sysctl_binary.c starts developing security holes and the like through poor maintenance etc. Which seems entirely possible given the history of sys_sysctl.
Quoted 10 lines
Quoted 8 lines
Quoted 5 lines
It would be better to simply keep the commonly used binary sysctls as emulation around always (commonly = used by glibc and perhaps added by user printk feedback) That's very cheap because it's just a simple translation and can be done internally cheaper than going through the VFS with a bazillion of locks.
A micro optimization for code that does not exist. That is a bad trade off.
Hmm? There's plenty of glibc code that uses the binary sysctl.
Where? I grepped glibc today. The only use in a recent glibc is in glibc-ports for the support of arm inb/outb. The only other use in older glibc was checking to see if we ran on an SMP kernel.
Quoted 9 lines
Quoted 3 lines
Further it is my intention to optimize
/proc/syswhen I get the chance now that we don't have all of the old sysctl baggage holding back the code.The VFS will always be comparably slow I suspect; I'm not sure you can optimize it that much compared to a fast custom path (especially handling the kernel version should be really fast)
Quoted 5 lines
Quoted 3 lines
Ultimately what drives me most is that people are still accidentally adding binary sysctls, which no one uses or tests. For a recent example see:
Yes I agree new binary sysctls should just be deprecated right now.
Good. The only way to keep new ones from showing up is to that I know of is to move everything into an emulation layer. I have done the heavy lifting there and everything is emulated using the exact same code.
If you are ready to maintain and keep from diverging an implementation of reading the /proc/sys/kernel/version aka "#1 SMP Tue Oct 20 06:50:36 UTC 2009" go ahead. I expect it is no more than 20 lines of code.
Eric
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Andi KleenQuoted 13 lines · Andi Kleen
Quoted 12 lines · Eric W. Biederman
Quoted 9 lines · Andi Kleen
Quoted 5 lines · [email protected] (Eric W. Biederman) writes:
The glibc pthread code that uses sysctl has no problems if
sys_sysctlis gone. It both falls back to reading/proc/sysand it just controls an optimization and the code works with either result. Been there, done that.
/proc/sysis much slower than sysctl though. So you made program startup slower.
Quoted 6 lines
Quoted 4 lines
Not much slower, but slower. I just measured it in a case that favors sysctl and the ration is about 5:2. Or sysctl is about 2.5x faster. About 49usec for open/read/close on proc and 19usec for sysctl. In my emulation it is a bit slower than that.
That's not good.
Why?
Quoted 11 lines
Quoted 7 lines
Quoted 3 lines
Also I agree with Arjan that breaking such a common ABI is not really a good idea. But I think it's enough to only handle common sysctls that are actually used, which are very few.
Well I haven't broken anything at this point. I am simply edging us to the point when we are close to being able to forget about
sys_sysctlfor good.I think all-or-nothing that you have right now is a bad trade-off because it breaks an established interface used by lots of code (glibc)
Quoted 8 lines
You should have three states
a) all
b) common ones used by glibc and perhaps a few others only
c) noneI suspect most users would use (b), in fact (c) might be redundant if (b) is cheap enough (which it should be)
Next year I expect b == c.
If you think we need something better additional patches to sysctl_binary.c are welcome. Just add your custom fast path before the through the VFS.
Quoted 7 lines
Quoted 4 lines
As for the rest the common number of sysctls with glibc > 2.8 is exactly 0. Which makes compiling out
sys_sysctlsupport sane. Especially since we have been throwing a warning for years if anyone uses any of the others.Yes, but people ignore the warning. Perhaps should make it a
WARN()and track it with kernelops?
When I have googled for it I have seen applications getting fixed.
Regardless if the warning was there for them to ignore they have been warned. With my patches the maintenance overhead in the core kernel is low enough I don't think it matters. Unless sysctl_binary.c starts developing security holes and the like through poor maintenance etc. Which seems entirely possible given the history of sys_sysctl.
Quoted 10 lines
Quoted 8 lines
Quoted 5 lines
It would be better to simply keep the commonly used binary sysctls as emulation around always (commonly = used by glibc and perhaps added by user printk feedback) That's very cheap because it's just a simple translation and can be done internally cheaper than going through the VFS with a bazillion of locks.
A micro optimization for code that does not exist. That is a bad trade off.
Hmm? There's plenty of glibc code that uses the binary sysctl.
Where? I grepped glibc today. The only use in a recent glibc is in glibc-ports for the support of arm inb/outb. The only other use in older glibc was checking to see if we ran on an SMP kernel.
Quoted 9 lines
Quoted 3 lines
Further it is my intention to optimize
/proc/syswhen I get the chance now that we don't have all of the old sysctl baggage holding back the code.The VFS will always be comparably slow I suspect; I'm not sure you can optimize it that much compared to a fast custom path (especially handling the kernel version should be really fast)
Quoted 5 lines
Quoted 3 lines
Ultimately what drives me most is that people are still accidentally adding binary sysctls, which no one uses or tests. For a recent example see:
Yes I agree new binary sysctls should just be deprecated right now.
Good. The only way to keep new ones from showing up is to that I know of is to move everything into an emulation layer. I have done the heavy lifting there and everything is emulated using the exact same code.
If you are ready to maintain and keep from diverging an implementation of reading the /proc/sys/kernel/version aka
"#1 SMP Tue Oct 20 06:50:36 UTC 2009"
go ahead. I expect it is no more than 20 lines of code.
Eric
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Eric W. BiedermanQuoted 8 lines · Eric W. Biederman
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
The glibc pthread code that uses sysctl has no problems if
sys_sysctlis gone. It both falls back to reading/proc/sysand it just controls an optimization and the code works with either result. Been there, done that.
/proc/sysis much slower than sysctl though. So you made program startup slower.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Not much slower, but slower. I just measured it in a case that favors sysctl and the ration is about 5:2. Or sysctl is about 2.5x faster. About 49usec for open/read/close on proc and 19usec for sysctl. In my emulation it is a bit slower than that.
That's not good.
Why?
Because it slows down a very common path.
Quoted 9 lines
Quoted 7 lines
a) all
b) common ones used by glibc and perhaps a few others only
c) noneI suspect most users would use (b), in fact (c) might be redundant if (b) is cheap enough (which it should be)
Next year I expect b == c.
Only if you ignore ABI compatibility.
Quoted 4 lines
If you think we need something better additional patches to
sysctl_binary.care welcome. Just add your custom fast path before the through the VFS.
I think sysctl_binary should be just stripped down for common sysctls (at least with a CONFIG)
Quoted 5 lines
Quoted 1 line
Hmm? There's plenty of glibc code that uses the binary sysctl.
Where? I grepped glibc today. The only use in a recent glibc is in glibc-ports for the support of arm inb/outb. The only other use in older glibc was checking to see if we ran on an SMP kernel.
That older glibc is widely deployed. And it won't go away next year.
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
Ultimately what drives me most is that people are still accidentally adding binary sysctls, which no one uses or tests. For a recent example see:
Yes I agree new binary sysctls should just be deprecated right now.
Good. The only way to keep new ones from showing up is to that I know of is to move everything into an emulation layer. I have done the heavy lifting there and everything is emulated using the exact same code.
I agree with that.
I just think you should have two flavours of emulation layer:
full and "common sysctls". This can be probably done with the same code and some strategic ifdefs.
-Andi
Signature · 1 line
[email protected] -- Speaking for myself only.
Re: [PATCH 15/23] sysctl mips/lasat: Remove dead binary sysctl support
In reply to Eric W. BiedermanQuoted 10 lines · Eric W. Biederman
From: Eric W. Biederman <[email protected]>
Now that
sys_sysctlis a generic wrapper around/proc/sys.ctl_name and .strategy members of sysctl tables are dead code. Remove them.The deleted strategy routines here surprise me.
ctl_namewasCTL_UNNUMBEREDso they would not have been called at all.Cc Ralf Baechle <[email protected]>Signed-off-by Eric W. Biederman <[email protected]>
Ralf
Arnd Bergmann
maintainerRe: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Andi KleenQuoted 7 lines · Andi Kleen
Quoted 5 lines · Eric W. Biederman
Quoted 5 lines
Quoted 4 lines
Not much slower, but slower. I just measured it in a case that favors sysctl and the ration is about 5:2. Or sysctl is about 2.5x faster. About 49usec for open/read/close on proc and 19usec for sysctl. In my emulation it is a bit slower than that.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
That's not good.
Why?
Because it slows down a very common path.
Can you name one binary sysctl value that gets accessed more than a few times during the execution of a vaguely common application? We're talking about microseconds for typically write-once or read-once settings.
Quoted 6 lines
Quoted 3 lines
If you think we need something better additional patches to
sysctl_binary.care welcome. Just add your custom fast path before the through the VFS.I think
sysctl_binaryshould be just stripped down for common sysctls (at least with a CONFIG)
It would technically be the same result, whether you add a fast path for common ones, or leave the current code in place or leave out the uncommon ones. In both cases, we'd still need the emulation code that Eric did.
The question is just how many sysctl values you regard as both common and performance critical.
Eric was implying 'none to very few', and that seems highly likely to me. If you can come up with proof for the opposite (e.g. in form of a list), that might make it sensible that stripping the current code down would be easier.
Even then, Eric is likely the only person willing to do that job, so he should be allowed to choose the implementation between functionally equivalent solutions.
Quoted 7 lines
Quoted 5 lines
Quoted 1 line
Hmm? There's plenty of glibc code that uses the binary sysctl.
Where? I grepped glibc today. The only use in a recent glibc is in glibc-ports for the support of arm inb/outb. The only other use in older glibc was checking to see if we ran on an SMP kernel.
That older glibc is widely deployed. And it won't go away next year.
So? Most users of old glibc are also using old kernels, and they can still use the config option for the compatibility code. There wouldn't even be a performance penalty over new glibc with new kernels which already use procfs.
Quoted 10 lines
Quoted 9 lines
Quoted 5 lines
Quoted 3 lines
Ultimately what drives me most is that people are still accidentally adding binary sysctls, which no one uses or tests. For a recent example see:
Yes I agree new binary sysctls should just be deprecated right now.
Good. The only way to keep new ones from showing up is to that I know of is to move everything into an emulation layer. I have done the heavy lifting there and everything is emulated using the exact same code.
Quoted 5 lines
I agree with that.
I just think you should have two flavours of emulation layer:
full and "common sysctls". This can be probably done with the same code and some strategic ifdefs.
If it's just about code size, I totally wouldn't bother. Just put the emulation code in loadable module and add a 'printk("Warning, %s is using sysctl %s, wasting %d kb of kernel memory")' to it's module_init function.
Arnd <><
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
Quoted 4 lines
Can you name one binary sysctl value that gets accessed more than a few times during the execution of a vaguely common application? We're talking about microseconds for typically write-once or read-once settings.
For example shell scripts tend to execute programs quite a lot.
Quoted 2 lines
The question is just how many sysctl values you regard as both common and performance critical.
Very little, I suspect in fact it's only one.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
in glibc-ports for the support of arm inb/outb. The only other use in older glibc was checking to see if we ran on an SMP kernel.
That older glibc is widely deployed. And it won't go away next year.
So? Most users of old glibc are also using old kernels, and they
How do you know? At least here it's quite common to use new kernels with old user land.
Quoted 3 lines
can still use the config option for the compatibility code. There wouldn't even be a performance penalty over new glibc with new kernels which already use procfs.
When he drops the sysctl(2) API completely the old userland will be unhappy.
Quoted 8 lines
Quoted 3 lines
I just think you should have two flavours of emulation layer:
full and "common sysctls". This can be probably done with the same code and some strategic ifdefs.If it's just about code size, I totally wouldn't bother. Just put the emulation code in loadable module and add a '
printk("Warning, %s is using sysctl %s, wasting %d kb of kernel memory")' to it'smodule_initfunction.
That means non modular kernels can't support old userland.
-Andi
Signature · 1 line
[email protected] -- Speaking for myself only.
Arnd Bergmann
maintainerRe: [PATCH 22/23] sysctl arm: Remove binary sysctl support
Quoted 5 lines · Andi Kleen
Quoted 2 lines
So? Most users of old glibc are also using old kernels, and they
How do you know? At least here it's quite common to use new kernels with old user land.
If by 'here' you mean kernel developers, sure. Other people I'd assume typically run whatever comes with the distro, and that usually includes both a libc and a kernel.
Quoted 6 lines
Quoted 3 lines
can still use the config option for the compatibility code. There wouldn't even be a performance penalty over new glibc with new kernels which already use procfs.
When he drops the sysctl(2) API completely the old userland will be unhappy.
I did not get the impression that this was the plan. Maybe I missed something, but the work that Eric did seemed to be strategic for leaving the code around for a really long time without causing any maintainance pain that the current code does.
It will be years before we can really remove that code, but distros can start disabling it (or making it modular) earlier than that when they feel the time has come to stop support for static binaries using sysctl (there should really be few of those).
Quoted 10 lines
Quoted 8 lines
Quoted 3 lines
I just think you should have two flavours of emulation layer:
full and "common sysctls". This can be probably done with the same code and some strategic ifdefs.If it's just about code size, I totally wouldn't bother. Just put the emulation code in loadable module and add a '
printk("Warning, %s is using sysctl %s, wasting %d kb of kernel memory")' to it'smodule_initfunction.That means non modular kernels can't support old userland.
Well, non-modular kernels are rather rare and they can still have the code builtin. It's not something I'd put a lot of work optmizing for though. I'd guess that most uses of non-modular kernels also come with a pretty much fixed set of supported binaries.
Arnd <><
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
Quoted 10 lines · Arnd Bergmann
Quoted 5 lines · Andi Kleen
Quoted 2 lines
So? Most users of old glibc are also using old kernels, and they
How do you know? At least here it's quite common to use new kernels with old user land.
If by 'here' you mean kernel developers, sure. Other people I'd assume typically run whatever comes with the distro, and that usually includes both a libc and a kernel.
The question with respect to my patchset. Is the increase in time a measurable performace regression or is the cost lost in the noise?
Andi do you know of a way to measure this?
Doing a special case for /proc/sys/kernel/version if someone can measure the overhead seem sane. But the double maintenance isn't my idea of fun.
The code involved would need to look something like:
if (len > sizeof(current->nsporxy->uts_ns.name.version) len = sizeof(current->nsporxy->uts_ns.name.version); down_read(&uts_sem); ret = copy_to_user(buf, current->nsproxy->uts_ns.name.version, len); up_read(&uts_sem);
That isn't a particular pretty expression, and it has a much higher chance of bitrotting than what I have now.
Quoted 12 lines
Quoted 6 lines
Quoted 3 lines
can still use the config option for the compatibility code. There wouldn't even be a performance penalty over new glibc with new kernels which already use procfs.
When he drops the sysctl(2) API completely the old userland will be unhappy.
I did not get the impression that this was the plan. Maybe I missed something, but the work that Eric did seemed to be strategic for leaving the code around for a really long time without causing any maintainance pain that the current code does.
Quoted 4 lines
It will be years before we can really remove that code, but distros can start disabling it (or making it modular) earlier than that when they feel the time has come to stop support for static binaries using sysctl (there should really be few of those).
There is always the question if we can get away with it. I intend to submit a patch that changes the default to off. Beyond that I don't don't know. I expect folks doing enterprise distro would want to turn of sys_sysctl because it is a typically buggy. Why chance bitrot leading to a security hole?
Eric
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Andi KleenQuoted 6 lines · Andi Kleen
Quoted 3 lines
can still use the config option for the compatibility code. There wouldn't even be a performance penalty over new glibc with new kernels which already use procfs.
When he drops the sysctl(2) API completely the old userland will be unhappy.
When it comes to breaking user space the issue is not glibc or anything in a open source distribution. There are maybe 3 apps that are affected at all and as far as I can tell they were all fixed long ago. Last time I investigated this in 2007 none of the existing userlands would break if sysctl was disabled completely.
The issue is all of the in-house and 3rd party software, that we don't have access to. We have no way of knowing what is used. So I do not favor a solution that kills some but not all sysctls. Either you might need them or you don't.
So the decision must be made to you break the rare app from the writer who has given you no feed back after you have given him fair warning, or do you try and support him forever, with code that no cares about and no one tests.
I think the solution in sysctl_binary.c strikes a good balance there. The code is simple and should survive a long time with little to no maintenance, so it is good if we need decide we are too chicken to disable the sysctl system call, and at the same time my changes remove the support overhead from everywhere else.
Further with the existence of a single file for all of the binary sysctls we can modify it to strike any other balance between long term maintainability, and removal of unused cruft.
I am happy to see additional patches from anyone else who chooses to seek a different balance.
Eric
Re: [PATCH 22/23] sysctl arm: Remove binary sysctl support
In reply to Andi KleenQuoted 11 lines · Andi Kleen
Quoted 4 lines
Can you name one binary sysctl value that gets accessed more than a few times during the execution of a vaguely common application? We're talking about microseconds for typically write-once or read-once settings.
For example shell scripts tend to execute programs quite a lot.
Quoted 2 lines
The question is just how many sysctl values you regard as both common and performance critical.
Very little, I suspect in fact it's only one.
I just took a second look, attempting to figure out how much startup overhead my sysctl used. I failed because I don't have a user space old enough that it calls sysctl. I had to go back all of the way to glibc-2.4 to find a version of nptl that calls sysctl at startup. glibc-2.5 on i386 uses uname and all other architectures uses either assumes smp is true or false without performing a system call.
I don't believe an inuse version of glibc exists that uses sysctl except the ioperm implementation on arm. So I can't see how being a little slower will impact anyone.
Eric
Re: [PATCH 02/23] sysctl: Stop using binary sysctl numbers in arlan.
In reply to Eric W. BiedermanQuoted 6 lines · Eric W. Biederman
From: Eric W. Biederman <[email protected]>
Looking at the arlan code it appears all of the sysctl entries are disabled debug code, and have not been enabled since the driver was merged in feb of 2003.
Quoted 7 lines
Since except for a select few that userspace can't get along without the binary sysctl table entries are going away. Kill the unused arlan binary sysctls.
Cc John W. Linville <[email protected]>Signed-off-by Eric W. Biederman <[email protected]>
ACK
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.