hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/net/rxrpc/sysctl.c
....@@ -1,12 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* sysctls for configuring RxRPC operating parameters
23 *
34 * Copyright (C) 2014 Red Hat, Inc. All Rights Reserved.
45 * Written by David Howells (dhowells@redhat.com)
5
- *
6
- * This program is free software; you can redistribute it and/or
7
- * modify it under the terms of the GNU General Public Licence
8
- * as published by the Free Software Foundation; either version
9
- * 2 of the Licence, or (at your option) any later version.
106 */
117
128 #include <linux/sysctl.h>
....@@ -15,9 +11,8 @@
1511 #include "ar-internal.h"
1612
1713 static struct ctl_table_header *rxrpc_sysctl_reg_table;
18
-static const unsigned int one = 1;
1914 static const unsigned int four = 4;
20
-static const unsigned int thirtytwo = 32;
15
+static const unsigned int max_backlog = RXRPC_BACKLOG_MAX - 1;
2116 static const unsigned int n_65535 = 65535;
2217 static const unsigned int n_max_acks = RXRPC_RXTX_BUFF_SIZE - 1;
2318 static const unsigned long one_jiffy = 1;
....@@ -26,7 +21,7 @@
2621 /*
2722 * RxRPC operating parameters.
2823 *
29
- * See Documentation/networking/rxrpc.txt and the variable definitions for more
24
+ * See Documentation/networking/rxrpc.rst and the variable definitions for more
3025 * information on the individual parameters.
3126 */
3227 static struct ctl_table rxrpc_sysctl_table[] = {
....@@ -76,33 +71,16 @@
7671 .extra1 = (void *)&one_jiffy,
7772 .extra2 = (void *)&max_jiffies,
7873 },
79
- {
80
- .procname = "resend_timeout",
81
- .data = &rxrpc_resend_timeout,
82
- .maxlen = sizeof(unsigned long),
83
- .mode = 0644,
84
- .proc_handler = proc_doulongvec_ms_jiffies_minmax,
85
- .extra1 = (void *)&one_jiffy,
86
- .extra2 = (void *)&max_jiffies,
87
- },
8874
8975 /* Non-time values */
90
- {
91
- .procname = "max_client_conns",
92
- .data = &rxrpc_max_client_connections,
93
- .maxlen = sizeof(unsigned int),
94
- .mode = 0644,
95
- .proc_handler = proc_dointvec_minmax,
96
- .extra1 = (void *)&rxrpc_reap_client_connections,
97
- },
9876 {
9977 .procname = "reap_client_conns",
10078 .data = &rxrpc_reap_client_connections,
10179 .maxlen = sizeof(unsigned int),
10280 .mode = 0644,
10381 .proc_handler = proc_dointvec_minmax,
104
- .extra1 = (void *)&one,
105
- .extra2 = (void *)&rxrpc_max_client_connections,
82
+ .extra1 = (void *)SYSCTL_ONE,
83
+ .extra2 = (void *)&n_65535,
10684 },
10785 {
10886 .procname = "max_backlog",
....@@ -111,7 +89,7 @@
11189 .mode = 0644,
11290 .proc_handler = proc_dointvec_minmax,
11391 .extra1 = (void *)&four,
114
- .extra2 = (void *)&thirtytwo,
92
+ .extra2 = (void *)&max_backlog,
11593 },
11694 {
11795 .procname = "rx_window_size",
....@@ -119,7 +97,7 @@
11997 .maxlen = sizeof(unsigned int),
12098 .mode = 0644,
12199 .proc_handler = proc_dointvec_minmax,
122
- .extra1 = (void *)&one,
100
+ .extra1 = (void *)SYSCTL_ONE,
123101 .extra2 = (void *)&n_max_acks,
124102 },
125103 {
....@@ -128,7 +106,7 @@
128106 .maxlen = sizeof(unsigned int),
129107 .mode = 0644,
130108 .proc_handler = proc_dointvec_minmax,
131
- .extra1 = (void *)&one,
109
+ .extra1 = (void *)SYSCTL_ONE,
132110 .extra2 = (void *)&n_65535,
133111 },
134112 {
....@@ -137,7 +115,7 @@
137115 .maxlen = sizeof(unsigned int),
138116 .mode = 0644,
139117 .proc_handler = proc_dointvec_minmax,
140
- .extra1 = (void *)&one,
118
+ .extra1 = (void *)SYSCTL_ONE,
141119 .extra2 = (void *)&four,
142120 },
143121