aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipvs
diff options
context:
space:
mode:
authorArjan van de Ven <arjan@infradead.org>2005-11-29 19:21:38 -0500
committerDavid S. Miller <davem@davemloft.net>2005-11-29 19:21:38 -0500
commit9b5b5cff9a6655dbb6d2e2be365bb95eec3950eb (patch)
tree80517910c731fc48512ba9c31aa823575db405b3 /net/ipv4/ipvs
parentfb29644994744a63bc57186cefa79534b5d9b5a9 (diff)
[NET]: Add const markers to various variables.
the patch below marks various variables const in net/; the goal is to move them to the .rodata section so that they can't false-share cachelines with things that get written to, as well as potentially helping gcc a bit with optimisations. (these were found using a gcc patch to warn about such variables) Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ipvs')
-rw-r--r--net/ipv4/ipvs/ip_vs_conn.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_tcp.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index f828fa2eb7de..2a3a8c59c655 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -771,7 +771,7 @@ static inline int todrop_entry(struct ip_vs_conn *cp)
771 * The drop rate array needs tuning for real environments. 771 * The drop rate array needs tuning for real environments.
772 * Called from timer bh only => no locking 772 * Called from timer bh only => no locking
773 */ 773 */
774 static char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8}; 774 static const char todrop_rate[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
775 static char todrop_counter[9] = {0}; 775 static char todrop_counter[9] = {0};
776 int i; 776 int i;
777 777
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 2d66848e7aa0..9bdcf31b760e 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -1909,7 +1909,7 @@ static int ip_vs_set_timeout(struct ip_vs_timeout_user *u)
1909#define DAEMON_ARG_LEN (sizeof(struct ip_vs_daemon_user)) 1909#define DAEMON_ARG_LEN (sizeof(struct ip_vs_daemon_user))
1910#define MAX_ARG_LEN SVCDEST_ARG_LEN 1910#define MAX_ARG_LEN SVCDEST_ARG_LEN
1911 1911
1912static unsigned char set_arglen[SET_CMDID(IP_VS_SO_SET_MAX)+1] = { 1912static const unsigned char set_arglen[SET_CMDID(IP_VS_SO_SET_MAX)+1] = {
1913 [SET_CMDID(IP_VS_SO_SET_ADD)] = SERVICE_ARG_LEN, 1913 [SET_CMDID(IP_VS_SO_SET_ADD)] = SERVICE_ARG_LEN,
1914 [SET_CMDID(IP_VS_SO_SET_EDIT)] = SERVICE_ARG_LEN, 1914 [SET_CMDID(IP_VS_SO_SET_EDIT)] = SERVICE_ARG_LEN,
1915 [SET_CMDID(IP_VS_SO_SET_DEL)] = SERVICE_ARG_LEN, 1915 [SET_CMDID(IP_VS_SO_SET_DEL)] = SERVICE_ARG_LEN,
@@ -2180,7 +2180,7 @@ __ip_vs_get_timeouts(struct ip_vs_timeout_user *u)
2180#define GET_TIMEOUT_ARG_LEN (sizeof(struct ip_vs_timeout_user)) 2180#define GET_TIMEOUT_ARG_LEN (sizeof(struct ip_vs_timeout_user))
2181#define GET_DAEMON_ARG_LEN (sizeof(struct ip_vs_daemon_user) * 2) 2181#define GET_DAEMON_ARG_LEN (sizeof(struct ip_vs_daemon_user) * 2)
2182 2182
2183static unsigned char get_arglen[GET_CMDID(IP_VS_SO_GET_MAX)+1] = { 2183static const unsigned char get_arglen[GET_CMDID(IP_VS_SO_GET_MAX)+1] = {
2184 [GET_CMDID(IP_VS_SO_GET_VERSION)] = 64, 2184 [GET_CMDID(IP_VS_SO_GET_VERSION)] = 64,
2185 [GET_CMDID(IP_VS_SO_GET_INFO)] = GET_INFO_ARG_LEN, 2185 [GET_CMDID(IP_VS_SO_GET_INFO)] = GET_INFO_ARG_LEN,
2186 [GET_CMDID(IP_VS_SO_GET_SERVICES)] = GET_SERVICES_ARG_LEN, 2186 [GET_CMDID(IP_VS_SO_GET_SERVICES)] = GET_SERVICES_ARG_LEN,
diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c
index c19408973c09..0e878fd6215c 100644
--- a/net/ipv4/ipvs/ip_vs_proto_tcp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c
@@ -251,7 +251,7 @@ tcp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
251#define TCP_DIR_OUTPUT 4 251#define TCP_DIR_OUTPUT 4
252#define TCP_DIR_INPUT_ONLY 8 252#define TCP_DIR_INPUT_ONLY 8
253 253
254static int tcp_state_off[IP_VS_DIR_LAST] = { 254static const int tcp_state_off[IP_VS_DIR_LAST] = {
255 [IP_VS_DIR_INPUT] = TCP_DIR_INPUT, 255 [IP_VS_DIR_INPUT] = TCP_DIR_INPUT,
256 [IP_VS_DIR_OUTPUT] = TCP_DIR_OUTPUT, 256 [IP_VS_DIR_OUTPUT] = TCP_DIR_OUTPUT,
257 [IP_VS_DIR_INPUT_ONLY] = TCP_DIR_INPUT_ONLY, 257 [IP_VS_DIR_INPUT_ONLY] = TCP_DIR_INPUT_ONLY,