: Collect all scattered sysctl variables into sysctl.c
PATCH 1/5 : Collect all scattered sysctl variables into sysctl.c
[DCCP]: Collect all scattered sysctl variables into sysctl.c
This
1. organizes the sysctl variables which are scattered over many DCCP source
files into sysctl.c - so that they can easier be found;
2. wraps the compilation of the CONFIG_SYSCTL part into a conditional define
- if not enabled, then only the variables will be `compiled';
3. shortens the definitions of init/exit dummy functions in the header file.
Hence mainly a tidy-up action. Code was found to compile and work cleanly with various Kconfig configurations for SYSCTL.
--- net/dccp/Makefile | 5 ++--- net/dccp/dccp.h | 10 ++-------- net/dccp/options.c | 7 ------- net/dccp/proto.c | 3 --- net/dccp/sysctl.c | 23 +++++++++++++++++++---- net/dccp/timer.c | 5 ----- 6 files changed, 23 insertions(+), 30 deletions(-)
net/dccp/proto.c +0 -3
@@ -52,9 +52,6 @@ struct inet_hashinfo __cacheline_alignedEXPORT_SYMBOL_GPL (dccp_hashinfo); -/* the maximum queue length for tx in packets. 0 is no limit */ -int sysctl_dccp_tx_qlen__read_mostly =5 ; -/* Forward Declarations. */ static void dccp_handle_passive_close (struct sock *sk);
net/dccp/timer.c +0 -5
@@ -15,11 +15,6 @@#include "dccp.h" -/* sysctl variables governing numbers of retransmission attempts */ -int sysctl_dccp_request_retries__read_mostly =TCP_SYN_RETRIES ; -int sysctl_dccp_retries1__read_mostly =TCP_RETR1 ; -int sysctl_dccp_retries2__read_mostly =TCP_RETR2 ; -static void dccp_write_err (struct sock *sk) { sk->sk_err = sk->sk_err_soft ? :ETIMEDOUT ;
net/dccp/options.c +0 -7
@@ -23,13 +23,6 @@#include "dccp.h" #include "feat.h" -int sysctl_dccp_feat_sequence_window =DCCPF_INITIAL_SEQUENCE_WINDOW ; -int sysctl_dccp_feat_rx_ccid =DCCPF_INITIAL_CCID ; -int sysctl_dccp_feat_tx_ccid =DCCPF_INITIAL_CCID ; -int sysctl_dccp_feat_ack_ratio =DCCPF_INITIAL_ACK_RATIO ; -int sysctl_dccp_feat_send_ack_vector =DCCPF_INITIAL_SEND_ACK_VECTOR ; -int sysctl_dccp_feat_send_ndp_count =DCCPF_INITIAL_SEND_NDP_COUNT ; -void dccp_minisock_init (struct dccp_minisock *dmsk) { dmsk->dccpms_sequence_window = sysctl_dccp_feat_sequence_window;
net/dccp/sysctl.c +19 -4
@@ -14,13 +14,27 @@#include "dccp.h" #include "feat.h" -#ifndef CONFIG_SYSCTL -#error This file should not be compiled without CONFIG_SYSCTL defined -#endif +/* sysctls related to initialisation of option values */ +int sysctl_dccp_feat_sequence_window =DCCPF_INITIAL_SEQUENCE_WINDOW ; +int sysctl_dccp_feat_rx_ccid =DCCPF_INITIAL_CCID ; +int sysctl_dccp_feat_tx_ccid =DCCPF_INITIAL_CCID ; +int sysctl_dccp_feat_ack_ratio =DCCPF_INITIAL_ACK_RATIO ; +int sysctl_dccp_feat_send_ack_vector =DCCPF_INITIAL_SEND_ACK_VECTOR ; +int sysctl_dccp_feat_send_ndp_count =DCCPF_INITIAL_SEND_NDP_COUNT ; + +/* the maximum queue length for tx in packets. 0 is no limit */ +int sysctl_dccp_tx_qlen__read_mostly =5 ; + +/* sysctl variables governing numbers of retransmission attempts */ +int sysctl_dccp_request_retries__read_mostly =TCP_SYN_RETRIES ; +int sysctl_dccp_retries1__read_mostly =TCP_RETR1 ; +int sysctl_dccp_retries2__read_mostly =TCP_RETR2 ;/* rate-limit for syncs in reply to sequence-invalid packets; RFC 4340, 7.5.4 */ -int sysctl_dccp_sync_ratelimit__read_mostly =HZ /8 ; +int sysctl_dccp_sync_ratelimit__read_mostly =HZ /8 ; + +#ifdef CONFIG_SYSCTL static struct ctl_table dccp_default_table[] = { { .procname = "seq_window",
@@ -149,3 +163,4 @@ void dccp_sysctl_exit(void) dccp_table_header = NULL; } } +#endif
net/dccp/Makefile +2 -3
@@ -1,6 +1,7 @@ obj-$(CONFIG_IP_DCCP) += dccp.o dccp_ipv4.o -dccp-y := ccid.o feat.o input.o minisocks.o options.o output.o proto.o timer.o +dccp-y := ccid.o feat.o input.o minisocks.o options.o output.o proto.o timer.o \ + sysctl.o dccp_ipv4-y := ipv4.o
@@ -13,8 +14,6 @@ dccp-$(CONFIG_IP_DCCP_ACKVEC) += ackvec. obj-$(CONFIG_INET_DCCP_DIAG) += dccp_diag.o obj-$(CONFIG_NET_DCCPPROBE) += dccp_probe.o -dccp-$(CONFIG_SYSCTL) += sysctl.o - dccp_diag-y := diag.o dccp_probe-y := probe.o
net/dccp/dccp.h +2 -8
@@ -462,14 +462,8 @@ static inline void timeval_sub_usecs(strextern int dccp_sysctl_init (void );extern void dccp_sysctl_exit (void );#else -static inline int dccp_sysctl_init (void ) -{ -return 0 ; -} - -static inline void dccp_sysctl_exit (void ) -{ -} +#define dccp_sysctl_init (void) (0) +#define dccp_sysctl_exit (void)#endif #endif /* _DCCP_H */
Quoted 5 lines · Gerrit Renker
[DCCP]: Collect all scattered sysctl variables into
sysctl.cThis
1. organizes the sysctl variables which are scattered over many DCCP sourcefiles into sysctl.c - so that they can easier be found;
Quoted 8 lines
2. wraps the compilation of the
CONFIG_SYSCTLpart into a conditional define
- if not enabled, then only the variables will be `compiled';
3. shortens the definitions of init/exit dummy functions in the header file.Hence mainly a tidy-up action. Code was found to compile and work cleanly with various
Kconfigconfigurations for SYSCTL.Signed-off-by Gerrit Renker <[email protected]>
Signature · 3 lines
Web1: http://wand.net.nz/~iam4/ Web2: http://www.jandi.co.nz Blog: http://iansblog.jandi.co.nz