diff options
Diffstat (limited to 'net/ipv4/ipvs')
-rw-r--r-- | net/ipv4/ipvs/ip_vs_app.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_conn.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_core.c | 5 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_ctl.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_dh.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_est.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_ftp.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_lblc.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_lblcr.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_lc.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_nq.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_proto.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_proto_ah.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_proto_esp.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_proto_tcp.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_proto_udp.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_rr.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_sched.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_sed.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_sh.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_sync.c | 433 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_wlc.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_wrr.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_xmit.c | 2 |
24 files changed, 174 insertions, 308 deletions
diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c index 535abe0c45e7..1f1897a1a702 100644 --- a/net/ipv4/ipvs/ip_vs_app.c +++ b/net/ipv4/ipvs/ip_vs_app.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * ip_vs_app.c: Application module support for IPVS | 2 | * ip_vs_app.c: Application module support for IPVS |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_app.c,v 1.17 2003/03/22 06:31:21 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * | 5 | * |
8 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c index 65f1ba112752..f8bdae47a77f 100644 --- a/net/ipv4/ipvs/ip_vs_conn.c +++ b/net/ipv4/ipvs/ip_vs_conn.c | |||
@@ -5,8 +5,6 @@ | |||
5 | * high-performance and highly available server based on a | 5 | * high-performance and highly available server based on a |
6 | * cluster of servers. | 6 | * cluster of servers. |
7 | * | 7 | * |
8 | * Version: $Id: ip_vs_conn.c,v 1.31 2003/04/18 09:03:16 wensong Exp $ | ||
9 | * | ||
10 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 8 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
11 | * Peter Kese <peter.kese@ijs.si> | 9 | * Peter Kese <peter.kese@ijs.si> |
12 | * Julian Anastasov <ja@ssi.bg> | 10 | * Julian Anastasov <ja@ssi.bg> |
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c index 963981a9d501..a7879eafc3b5 100644 --- a/net/ipv4/ipvs/ip_vs_core.c +++ b/net/ipv4/ipvs/ip_vs_core.c | |||
@@ -5,8 +5,6 @@ | |||
5 | * high-performance and highly available server based on a | 5 | * high-performance and highly available server based on a |
6 | * cluster of servers. | 6 | * cluster of servers. |
7 | * | 7 | * |
8 | * Version: $Id: ip_vs_core.c,v 1.34 2003/05/10 03:05:23 wensong Exp $ | ||
9 | * | ||
10 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 8 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
11 | * Peter Kese <peter.kese@ijs.si> | 9 | * Peter Kese <peter.kese@ijs.si> |
12 | * Julian Anastasov <ja@ssi.bg> | 10 | * Julian Anastasov <ja@ssi.bg> |
@@ -993,7 +991,8 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, | |||
993 | == sysctl_ip_vs_sync_threshold[0])) || | 991 | == sysctl_ip_vs_sync_threshold[0])) || |
994 | ((cp->protocol == IPPROTO_TCP) && (cp->old_state != cp->state) && | 992 | ((cp->protocol == IPPROTO_TCP) && (cp->old_state != cp->state) && |
995 | ((cp->state == IP_VS_TCP_S_FIN_WAIT) || | 993 | ((cp->state == IP_VS_TCP_S_FIN_WAIT) || |
996 | (cp->state == IP_VS_TCP_S_CLOSE))))) | 994 | (cp->state == IP_VS_TCP_S_CLOSE_WAIT) || |
995 | (cp->state == IP_VS_TCP_S_TIME_WAIT))))) | ||
997 | ip_vs_sync_conn(cp); | 996 | ip_vs_sync_conn(cp); |
998 | cp->old_state = cp->state; | 997 | cp->old_state = cp->state; |
999 | 998 | ||
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c index 94c5767c8e01..9a5ace0b4dd6 100644 --- a/net/ipv4/ipvs/ip_vs_ctl.c +++ b/net/ipv4/ipvs/ip_vs_ctl.c | |||
@@ -5,8 +5,6 @@ | |||
5 | * high-performance and highly available server based on a | 5 | * high-performance and highly available server based on a |
6 | * cluster of servers. | 6 | * cluster of servers. |
7 | * | 7 | * |
8 | * Version: $Id: ip_vs_ctl.c,v 1.36 2003/06/08 09:31:19 wensong Exp $ | ||
9 | * | ||
10 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 8 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
11 | * Peter Kese <peter.kese@ijs.si> | 9 | * Peter Kese <peter.kese@ijs.si> |
12 | * Julian Anastasov <ja@ssi.bg> | 10 | * Julian Anastasov <ja@ssi.bg> |
diff --git a/net/ipv4/ipvs/ip_vs_dh.c b/net/ipv4/ipvs/ip_vs_dh.c index dcf5d46aaa5e..8afc1503ed20 100644 --- a/net/ipv4/ipvs/ip_vs_dh.c +++ b/net/ipv4/ipvs/ip_vs_dh.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * IPVS: Destination Hashing scheduling module | 2 | * IPVS: Destination Hashing scheduling module |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_dh.c,v 1.5 2002/09/15 08:14:08 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@gnuchina.org> | 4 | * Authors: Wensong Zhang <wensong@gnuchina.org> |
7 | * | 5 | * |
8 | * Inspired by the consistent hashing scheduler patch from | 6 | * Inspired by the consistent hashing scheduler patch from |
diff --git a/net/ipv4/ipvs/ip_vs_est.c b/net/ipv4/ipvs/ip_vs_est.c index dfa0d713c801..bc04eedd6dbb 100644 --- a/net/ipv4/ipvs/ip_vs_est.c +++ b/net/ipv4/ipvs/ip_vs_est.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * ip_vs_est.c: simple rate estimator for IPVS | 2 | * ip_vs_est.c: simple rate estimator for IPVS |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_est.c,v 1.4 2002/11/30 01:50:35 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * | 5 | * |
8 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c index 59aa166b7678..c1c758e4f733 100644 --- a/net/ipv4/ipvs/ip_vs_ftp.c +++ b/net/ipv4/ipvs/ip_vs_ftp.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * ip_vs_ftp.c: IPVS ftp application module | 2 | * ip_vs_ftp.c: IPVS ftp application module |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_ftp.c,v 1.13 2002/09/15 08:14:08 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * | 5 | * |
8 | * Changes: | 6 | * Changes: |
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c index 3888642706ad..0efa3db4b180 100644 --- a/net/ipv4/ipvs/ip_vs_lblc.c +++ b/net/ipv4/ipvs/ip_vs_lblc.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * IPVS: Locality-Based Least-Connection scheduling module | 2 | * IPVS: Locality-Based Least-Connection scheduling module |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_lblc.c,v 1.10 2002/09/15 08:14:08 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@gnuchina.org> | 4 | * Authors: Wensong Zhang <wensong@gnuchina.org> |
7 | * | 5 | * |
8 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c index daa260eb21cf..8e3bbeb45138 100644 --- a/net/ipv4/ipvs/ip_vs_lblcr.c +++ b/net/ipv4/ipvs/ip_vs_lblcr.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * IPVS: Locality-Based Least-Connection with Replication scheduler | 2 | * IPVS: Locality-Based Least-Connection with Replication scheduler |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_lblcr.c,v 1.11 2002/09/15 08:14:08 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@gnuchina.org> | 4 | * Authors: Wensong Zhang <wensong@gnuchina.org> |
7 | * | 5 | * |
8 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
diff --git a/net/ipv4/ipvs/ip_vs_lc.c b/net/ipv4/ipvs/ip_vs_lc.c index d88fef90a641..ac9f08e065d5 100644 --- a/net/ipv4/ipvs/ip_vs_lc.c +++ b/net/ipv4/ipvs/ip_vs_lc.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * IPVS: Least-Connection Scheduling module | 2 | * IPVS: Least-Connection Scheduling module |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_lc.c,v 1.10 2003/04/18 09:03:16 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * | 5 | * |
8 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
diff --git a/net/ipv4/ipvs/ip_vs_nq.c b/net/ipv4/ipvs/ip_vs_nq.c index bc2a9e5f2a7b..a46bf258d420 100644 --- a/net/ipv4/ipvs/ip_vs_nq.c +++ b/net/ipv4/ipvs/ip_vs_nq.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * IPVS: Never Queue scheduling module | 2 | * IPVS: Never Queue scheduling module |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_nq.c,v 1.2 2003/06/08 09:31:19 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * | 5 | * |
8 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c index 4b1c16cbb16b..876714f23d65 100644 --- a/net/ipv4/ipvs/ip_vs_proto.c +++ b/net/ipv4/ipvs/ip_vs_proto.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * ip_vs_proto.c: transport protocol load balancing support for IPVS | 2 | * ip_vs_proto.c: transport protocol load balancing support for IPVS |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_proto.c,v 1.2 2003/04/18 09:03:16 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * Julian Anastasov <ja@ssi.bg> | 5 | * Julian Anastasov <ja@ssi.bg> |
8 | * | 6 | * |
diff --git a/net/ipv4/ipvs/ip_vs_proto_ah.c b/net/ipv4/ipvs/ip_vs_proto_ah.c index 4bf835e1d86d..73e0ea87c1f5 100644 --- a/net/ipv4/ipvs/ip_vs_proto_ah.c +++ b/net/ipv4/ipvs/ip_vs_proto_ah.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * ip_vs_proto_ah.c: AH IPSec load balancing support for IPVS | 2 | * ip_vs_proto_ah.c: AH IPSec load balancing support for IPVS |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_proto_ah.c,v 1.1 2003/07/04 15:04:37 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Julian Anastasov <ja@ssi.bg>, February 2002 | 4 | * Authors: Julian Anastasov <ja@ssi.bg>, February 2002 |
7 | * Wensong Zhang <wensong@linuxvirtualserver.org> | 5 | * Wensong Zhang <wensong@linuxvirtualserver.org> |
8 | * | 6 | * |
diff --git a/net/ipv4/ipvs/ip_vs_proto_esp.c b/net/ipv4/ipvs/ip_vs_proto_esp.c index db6a6b7b1a0b..21d70c8ffa54 100644 --- a/net/ipv4/ipvs/ip_vs_proto_esp.c +++ b/net/ipv4/ipvs/ip_vs_proto_esp.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * ip_vs_proto_esp.c: ESP IPSec load balancing support for IPVS | 2 | * ip_vs_proto_esp.c: ESP IPSec load balancing support for IPVS |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_proto_esp.c,v 1.1 2003/07/04 15:04:37 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Julian Anastasov <ja@ssi.bg>, February 2002 | 4 | * Authors: Julian Anastasov <ja@ssi.bg>, February 2002 |
7 | * Wensong Zhang <wensong@linuxvirtualserver.org> | 5 | * Wensong Zhang <wensong@linuxvirtualserver.org> |
8 | * | 6 | * |
diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c index b83dc14b0a4d..d0ea467986a0 100644 --- a/net/ipv4/ipvs/ip_vs_proto_tcp.c +++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * ip_vs_proto_tcp.c: TCP load balancing support for IPVS | 2 | * ip_vs_proto_tcp.c: TCP load balancing support for IPVS |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_proto_tcp.c,v 1.3 2002/11/30 01:50:35 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * Julian Anastasov <ja@ssi.bg> | 5 | * Julian Anastasov <ja@ssi.bg> |
8 | * | 6 | * |
diff --git a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c index 75771cb3cd6f..c6be5d56823f 100644 --- a/net/ipv4/ipvs/ip_vs_proto_udp.c +++ b/net/ipv4/ipvs/ip_vs_proto_udp.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * ip_vs_proto_udp.c: UDP load balancing support for IPVS | 2 | * ip_vs_proto_udp.c: UDP load balancing support for IPVS |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_proto_udp.c,v 1.3 2002/11/30 01:50:35 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * Julian Anastasov <ja@ssi.bg> | 5 | * Julian Anastasov <ja@ssi.bg> |
8 | * | 6 | * |
diff --git a/net/ipv4/ipvs/ip_vs_rr.c b/net/ipv4/ipvs/ip_vs_rr.c index 433f8a947924..c8db12d39e61 100644 --- a/net/ipv4/ipvs/ip_vs_rr.c +++ b/net/ipv4/ipvs/ip_vs_rr.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * IPVS: Round-Robin Scheduling module | 2 | * IPVS: Round-Robin Scheduling module |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_rr.c,v 1.9 2002/09/15 08:14:08 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * Peter Kese <peter.kese@ijs.si> | 5 | * Peter Kese <peter.kese@ijs.si> |
8 | * | 6 | * |
diff --git a/net/ipv4/ipvs/ip_vs_sched.c b/net/ipv4/ipvs/ip_vs_sched.c index 121a32b1b756..b64767309855 100644 --- a/net/ipv4/ipvs/ip_vs_sched.c +++ b/net/ipv4/ipvs/ip_vs_sched.c | |||
@@ -5,8 +5,6 @@ | |||
5 | * high-performance and highly available server based on a | 5 | * high-performance and highly available server based on a |
6 | * cluster of servers. | 6 | * cluster of servers. |
7 | * | 7 | * |
8 | * Version: $Id: ip_vs_sched.c,v 1.13 2003/05/10 03:05:23 wensong Exp $ | ||
9 | * | ||
10 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 8 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
11 | * Peter Kese <peter.kese@ijs.si> | 9 | * Peter Kese <peter.kese@ijs.si> |
12 | * | 10 | * |
diff --git a/net/ipv4/ipvs/ip_vs_sed.c b/net/ipv4/ipvs/ip_vs_sed.c index dd7c128f9db3..2a7d31358181 100644 --- a/net/ipv4/ipvs/ip_vs_sed.c +++ b/net/ipv4/ipvs/ip_vs_sed.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * IPVS: Shortest Expected Delay scheduling module | 2 | * IPVS: Shortest Expected Delay scheduling module |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_sed.c,v 1.1 2003/05/10 03:06:08 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * | 5 | * |
8 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
diff --git a/net/ipv4/ipvs/ip_vs_sh.c b/net/ipv4/ipvs/ip_vs_sh.c index 1b25b00ef1e1..b8fdfac65001 100644 --- a/net/ipv4/ipvs/ip_vs_sh.c +++ b/net/ipv4/ipvs/ip_vs_sh.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * IPVS: Source Hashing scheduling module | 2 | * IPVS: Source Hashing scheduling module |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_sh.c,v 1.5 2002/09/15 08:14:08 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@gnuchina.org> | 4 | * Authors: Wensong Zhang <wensong@gnuchina.org> |
7 | * | 5 | * |
8 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c index eff54efe0351..45e9bd96c286 100644 --- a/net/ipv4/ipvs/ip_vs_sync.c +++ b/net/ipv4/ipvs/ip_vs_sync.c | |||
@@ -5,8 +5,6 @@ | |||
5 | * high-performance and highly available server based on a | 5 | * high-performance and highly available server based on a |
6 | * cluster of servers. | 6 | * cluster of servers. |
7 | * | 7 | * |
8 | * Version: $Id: ip_vs_sync.c,v 1.13 2003/06/08 09:31:19 wensong Exp $ | ||
9 | * | ||
10 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 8 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
11 | * | 9 | * |
12 | * ip_vs_sync: sync connection info from master load balancer to backups | 10 | * ip_vs_sync: sync connection info from master load balancer to backups |
@@ -29,10 +27,12 @@ | |||
29 | #include <linux/in.h> | 27 | #include <linux/in.h> |
30 | #include <linux/igmp.h> /* for ip_mc_join_group */ | 28 | #include <linux/igmp.h> /* for ip_mc_join_group */ |
31 | #include <linux/udp.h> | 29 | #include <linux/udp.h> |
30 | #include <linux/err.h> | ||
31 | #include <linux/kthread.h> | ||
32 | #include <linux/wait.h> | ||
32 | 33 | ||
33 | #include <net/ip.h> | 34 | #include <net/ip.h> |
34 | #include <net/sock.h> | 35 | #include <net/sock.h> |
35 | #include <asm/uaccess.h> /* for get_fs and set_fs */ | ||
36 | 36 | ||
37 | #include <net/ip_vs.h> | 37 | #include <net/ip_vs.h> |
38 | 38 | ||
@@ -68,8 +68,8 @@ struct ip_vs_sync_conn_options { | |||
68 | }; | 68 | }; |
69 | 69 | ||
70 | struct ip_vs_sync_thread_data { | 70 | struct ip_vs_sync_thread_data { |
71 | struct completion *startup; | 71 | struct socket *sock; |
72 | int state; | 72 | char *buf; |
73 | }; | 73 | }; |
74 | 74 | ||
75 | #define SIMPLE_CONN_SIZE (sizeof(struct ip_vs_sync_conn)) | 75 | #define SIMPLE_CONN_SIZE (sizeof(struct ip_vs_sync_conn)) |
@@ -140,18 +140,19 @@ volatile int ip_vs_backup_syncid = 0; | |||
140 | char ip_vs_master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | 140 | char ip_vs_master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; |
141 | char ip_vs_backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; | 141 | char ip_vs_backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; |
142 | 142 | ||
143 | /* sync daemon tasks */ | ||
144 | static struct task_struct *sync_master_thread; | ||
145 | static struct task_struct *sync_backup_thread; | ||
146 | |||
143 | /* multicast addr */ | 147 | /* multicast addr */ |
144 | static struct sockaddr_in mcast_addr; | 148 | static struct sockaddr_in mcast_addr = { |
149 | .sin_family = AF_INET, | ||
150 | .sin_port = __constant_htons(IP_VS_SYNC_PORT), | ||
151 | .sin_addr.s_addr = __constant_htonl(IP_VS_SYNC_GROUP), | ||
152 | }; | ||
145 | 153 | ||
146 | 154 | ||
147 | static inline void sb_queue_tail(struct ip_vs_sync_buff *sb) | 155 | static inline struct ip_vs_sync_buff *sb_dequeue(void) |
148 | { | ||
149 | spin_lock(&ip_vs_sync_lock); | ||
150 | list_add_tail(&sb->list, &ip_vs_sync_queue); | ||
151 | spin_unlock(&ip_vs_sync_lock); | ||
152 | } | ||
153 | |||
154 | static inline struct ip_vs_sync_buff * sb_dequeue(void) | ||
155 | { | 156 | { |
156 | struct ip_vs_sync_buff *sb; | 157 | struct ip_vs_sync_buff *sb; |
157 | 158 | ||
@@ -195,6 +196,16 @@ static inline void ip_vs_sync_buff_release(struct ip_vs_sync_buff *sb) | |||
195 | kfree(sb); | 196 | kfree(sb); |
196 | } | 197 | } |
197 | 198 | ||
199 | static inline void sb_queue_tail(struct ip_vs_sync_buff *sb) | ||
200 | { | ||
201 | spin_lock(&ip_vs_sync_lock); | ||
202 | if (ip_vs_sync_state & IP_VS_STATE_MASTER) | ||
203 | list_add_tail(&sb->list, &ip_vs_sync_queue); | ||
204 | else | ||
205 | ip_vs_sync_buff_release(sb); | ||
206 | spin_unlock(&ip_vs_sync_lock); | ||
207 | } | ||
208 | |||
198 | /* | 209 | /* |
199 | * Get the current sync buffer if it has been created for more | 210 | * Get the current sync buffer if it has been created for more |
200 | * than the specified time or the specified time is zero. | 211 | * than the specified time or the specified time is zero. |
@@ -574,14 +585,17 @@ static int bind_mcastif_addr(struct socket *sock, char *ifname) | |||
574 | static struct socket * make_send_sock(void) | 585 | static struct socket * make_send_sock(void) |
575 | { | 586 | { |
576 | struct socket *sock; | 587 | struct socket *sock; |
588 | int result; | ||
577 | 589 | ||
578 | /* First create a socket */ | 590 | /* First create a socket */ |
579 | if (sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock) < 0) { | 591 | result = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock); |
592 | if (result < 0) { | ||
580 | IP_VS_ERR("Error during creation of socket; terminating\n"); | 593 | IP_VS_ERR("Error during creation of socket; terminating\n"); |
581 | return NULL; | 594 | return ERR_PTR(result); |
582 | } | 595 | } |
583 | 596 | ||
584 | if (set_mcast_if(sock->sk, ip_vs_master_mcast_ifn) < 0) { | 597 | result = set_mcast_if(sock->sk, ip_vs_master_mcast_ifn); |
598 | if (result < 0) { | ||
585 | IP_VS_ERR("Error setting outbound mcast interface\n"); | 599 | IP_VS_ERR("Error setting outbound mcast interface\n"); |
586 | goto error; | 600 | goto error; |
587 | } | 601 | } |
@@ -589,14 +603,15 @@ static struct socket * make_send_sock(void) | |||
589 | set_mcast_loop(sock->sk, 0); | 603 | set_mcast_loop(sock->sk, 0); |
590 | set_mcast_ttl(sock->sk, 1); | 604 | set_mcast_ttl(sock->sk, 1); |
591 | 605 | ||
592 | if (bind_mcastif_addr(sock, ip_vs_master_mcast_ifn) < 0) { | 606 | result = bind_mcastif_addr(sock, ip_vs_master_mcast_ifn); |
607 | if (result < 0) { | ||
593 | IP_VS_ERR("Error binding address of the mcast interface\n"); | 608 | IP_VS_ERR("Error binding address of the mcast interface\n"); |
594 | goto error; | 609 | goto error; |
595 | } | 610 | } |
596 | 611 | ||
597 | if (sock->ops->connect(sock, | 612 | result = sock->ops->connect(sock, (struct sockaddr *) &mcast_addr, |
598 | (struct sockaddr*)&mcast_addr, | 613 | sizeof(struct sockaddr), 0); |
599 | sizeof(struct sockaddr), 0) < 0) { | 614 | if (result < 0) { |
600 | IP_VS_ERR("Error connecting to the multicast addr\n"); | 615 | IP_VS_ERR("Error connecting to the multicast addr\n"); |
601 | goto error; | 616 | goto error; |
602 | } | 617 | } |
@@ -605,7 +620,7 @@ static struct socket * make_send_sock(void) | |||
605 | 620 | ||
606 | error: | 621 | error: |
607 | sock_release(sock); | 622 | sock_release(sock); |
608 | return NULL; | 623 | return ERR_PTR(result); |
609 | } | 624 | } |
610 | 625 | ||
611 | 626 | ||
@@ -615,27 +630,30 @@ static struct socket * make_send_sock(void) | |||
615 | static struct socket * make_receive_sock(void) | 630 | static struct socket * make_receive_sock(void) |
616 | { | 631 | { |
617 | struct socket *sock; | 632 | struct socket *sock; |
633 | int result; | ||
618 | 634 | ||
619 | /* First create a socket */ | 635 | /* First create a socket */ |
620 | if (sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock) < 0) { | 636 | result = sock_create_kern(PF_INET, SOCK_DGRAM, IPPROTO_UDP, &sock); |
637 | if (result < 0) { | ||
621 | IP_VS_ERR("Error during creation of socket; terminating\n"); | 638 | IP_VS_ERR("Error during creation of socket; terminating\n"); |
622 | return NULL; | 639 | return ERR_PTR(result); |
623 | } | 640 | } |
624 | 641 | ||
625 | /* it is equivalent to the REUSEADDR option in user-space */ | 642 | /* it is equivalent to the REUSEADDR option in user-space */ |
626 | sock->sk->sk_reuse = 1; | 643 | sock->sk->sk_reuse = 1; |
627 | 644 | ||
628 | if (sock->ops->bind(sock, | 645 | result = sock->ops->bind(sock, (struct sockaddr *) &mcast_addr, |
629 | (struct sockaddr*)&mcast_addr, | 646 | sizeof(struct sockaddr)); |
630 | sizeof(struct sockaddr)) < 0) { | 647 | if (result < 0) { |
631 | IP_VS_ERR("Error binding to the multicast addr\n"); | 648 | IP_VS_ERR("Error binding to the multicast addr\n"); |
632 | goto error; | 649 | goto error; |
633 | } | 650 | } |
634 | 651 | ||
635 | /* join the multicast group */ | 652 | /* join the multicast group */ |
636 | if (join_mcast_group(sock->sk, | 653 | result = join_mcast_group(sock->sk, |
637 | (struct in_addr*)&mcast_addr.sin_addr, | 654 | (struct in_addr *) &mcast_addr.sin_addr, |
638 | ip_vs_backup_mcast_ifn) < 0) { | 655 | ip_vs_backup_mcast_ifn); |
656 | if (result < 0) { | ||
639 | IP_VS_ERR("Error joining to the multicast group\n"); | 657 | IP_VS_ERR("Error joining to the multicast group\n"); |
640 | goto error; | 658 | goto error; |
641 | } | 659 | } |
@@ -644,7 +662,7 @@ static struct socket * make_receive_sock(void) | |||
644 | 662 | ||
645 | error: | 663 | error: |
646 | sock_release(sock); | 664 | sock_release(sock); |
647 | return NULL; | 665 | return ERR_PTR(result); |
648 | } | 666 | } |
649 | 667 | ||
650 | 668 | ||
@@ -702,44 +720,29 @@ ip_vs_receive(struct socket *sock, char *buffer, const size_t buflen) | |||
702 | } | 720 | } |
703 | 721 | ||
704 | 722 | ||
705 | static DECLARE_WAIT_QUEUE_HEAD(sync_wait); | 723 | static int sync_thread_master(void *data) |
706 | static pid_t sync_master_pid = 0; | ||
707 | static pid_t sync_backup_pid = 0; | ||
708 | |||
709 | static DECLARE_WAIT_QUEUE_HEAD(stop_sync_wait); | ||
710 | static int stop_master_sync = 0; | ||
711 | static int stop_backup_sync = 0; | ||
712 | |||
713 | static void sync_master_loop(void) | ||
714 | { | 724 | { |
715 | struct socket *sock; | 725 | struct ip_vs_sync_thread_data *tinfo = data; |
716 | struct ip_vs_sync_buff *sb; | 726 | struct ip_vs_sync_buff *sb; |
717 | 727 | ||
718 | /* create the sending multicast socket */ | ||
719 | sock = make_send_sock(); | ||
720 | if (!sock) | ||
721 | return; | ||
722 | |||
723 | IP_VS_INFO("sync thread started: state = MASTER, mcast_ifn = %s, " | 728 | IP_VS_INFO("sync thread started: state = MASTER, mcast_ifn = %s, " |
724 | "syncid = %d\n", | 729 | "syncid = %d\n", |
725 | ip_vs_master_mcast_ifn, ip_vs_master_syncid); | 730 | ip_vs_master_mcast_ifn, ip_vs_master_syncid); |
726 | 731 | ||
727 | for (;;) { | 732 | while (!kthread_should_stop()) { |
728 | while ((sb=sb_dequeue())) { | 733 | while ((sb = sb_dequeue())) { |
729 | ip_vs_send_sync_msg(sock, sb->mesg); | 734 | ip_vs_send_sync_msg(tinfo->sock, sb->mesg); |
730 | ip_vs_sync_buff_release(sb); | 735 | ip_vs_sync_buff_release(sb); |
731 | } | 736 | } |
732 | 737 | ||
733 | /* check if entries stay in curr_sb for 2 seconds */ | 738 | /* check if entries stay in curr_sb for 2 seconds */ |
734 | if ((sb = get_curr_sync_buff(2*HZ))) { | 739 | sb = get_curr_sync_buff(2 * HZ); |
735 | ip_vs_send_sync_msg(sock, sb->mesg); | 740 | if (sb) { |
741 | ip_vs_send_sync_msg(tinfo->sock, sb->mesg); | ||
736 | ip_vs_sync_buff_release(sb); | 742 | ip_vs_sync_buff_release(sb); |
737 | } | 743 | } |
738 | 744 | ||
739 | if (stop_master_sync) | 745 | schedule_timeout_interruptible(HZ); |
740 | break; | ||
741 | |||
742 | msleep_interruptible(1000); | ||
743 | } | 746 | } |
744 | 747 | ||
745 | /* clean up the sync_buff queue */ | 748 | /* clean up the sync_buff queue */ |
@@ -753,267 +756,175 @@ static void sync_master_loop(void) | |||
753 | } | 756 | } |
754 | 757 | ||
755 | /* release the sending multicast socket */ | 758 | /* release the sending multicast socket */ |
756 | sock_release(sock); | 759 | sock_release(tinfo->sock); |
760 | kfree(tinfo); | ||
761 | |||
762 | return 0; | ||
757 | } | 763 | } |
758 | 764 | ||
759 | 765 | ||
760 | static void sync_backup_loop(void) | 766 | static int sync_thread_backup(void *data) |
761 | { | 767 | { |
762 | struct socket *sock; | 768 | struct ip_vs_sync_thread_data *tinfo = data; |
763 | char *buf; | ||
764 | int len; | 769 | int len; |
765 | 770 | ||
766 | if (!(buf = kmalloc(sync_recv_mesg_maxlen, GFP_ATOMIC))) { | ||
767 | IP_VS_ERR("sync_backup_loop: kmalloc error\n"); | ||
768 | return; | ||
769 | } | ||
770 | |||
771 | /* create the receiving multicast socket */ | ||
772 | sock = make_receive_sock(); | ||
773 | if (!sock) | ||
774 | goto out; | ||
775 | |||
776 | IP_VS_INFO("sync thread started: state = BACKUP, mcast_ifn = %s, " | 771 | IP_VS_INFO("sync thread started: state = BACKUP, mcast_ifn = %s, " |
777 | "syncid = %d\n", | 772 | "syncid = %d\n", |
778 | ip_vs_backup_mcast_ifn, ip_vs_backup_syncid); | 773 | ip_vs_backup_mcast_ifn, ip_vs_backup_syncid); |
779 | 774 | ||
780 | for (;;) { | 775 | while (!kthread_should_stop()) { |
781 | /* do you have data now? */ | 776 | wait_event_interruptible(*tinfo->sock->sk->sk_sleep, |
782 | while (!skb_queue_empty(&(sock->sk->sk_receive_queue))) { | 777 | !skb_queue_empty(&tinfo->sock->sk->sk_receive_queue) |
783 | if ((len = | 778 | || kthread_should_stop()); |
784 | ip_vs_receive(sock, buf, | 779 | |
785 | sync_recv_mesg_maxlen)) <= 0) { | 780 | /* do we have data now? */ |
781 | while (!skb_queue_empty(&(tinfo->sock->sk->sk_receive_queue))) { | ||
782 | len = ip_vs_receive(tinfo->sock, tinfo->buf, | ||
783 | sync_recv_mesg_maxlen); | ||
784 | if (len <= 0) { | ||
786 | IP_VS_ERR("receiving message error\n"); | 785 | IP_VS_ERR("receiving message error\n"); |
787 | break; | 786 | break; |
788 | } | 787 | } |
789 | /* disable bottom half, because it accessed the data | 788 | |
789 | /* disable bottom half, because it accesses the data | ||
790 | shared by softirq while getting/creating conns */ | 790 | shared by softirq while getting/creating conns */ |
791 | local_bh_disable(); | 791 | local_bh_disable(); |
792 | ip_vs_process_message(buf, len); | 792 | ip_vs_process_message(tinfo->buf, len); |
793 | local_bh_enable(); | 793 | local_bh_enable(); |
794 | } | 794 | } |
795 | |||
796 | if (stop_backup_sync) | ||
797 | break; | ||
798 | |||
799 | msleep_interruptible(1000); | ||
800 | } | 795 | } |
801 | 796 | ||
802 | /* release the sending multicast socket */ | 797 | /* release the sending multicast socket */ |
803 | sock_release(sock); | 798 | sock_release(tinfo->sock); |
799 | kfree(tinfo->buf); | ||
800 | kfree(tinfo); | ||
804 | 801 | ||
805 | out: | 802 | return 0; |
806 | kfree(buf); | ||
807 | } | 803 | } |
808 | 804 | ||
809 | 805 | ||
810 | static void set_sync_pid(int sync_state, pid_t sync_pid) | 806 | int start_sync_thread(int state, char *mcast_ifn, __u8 syncid) |
811 | { | ||
812 | if (sync_state == IP_VS_STATE_MASTER) | ||
813 | sync_master_pid = sync_pid; | ||
814 | else if (sync_state == IP_VS_STATE_BACKUP) | ||
815 | sync_backup_pid = sync_pid; | ||
816 | } | ||
817 | |||
818 | static void set_stop_sync(int sync_state, int set) | ||
819 | { | 807 | { |
820 | if (sync_state == IP_VS_STATE_MASTER) | 808 | struct ip_vs_sync_thread_data *tinfo; |
821 | stop_master_sync = set; | 809 | struct task_struct **realtask, *task; |
822 | else if (sync_state == IP_VS_STATE_BACKUP) | 810 | struct socket *sock; |
823 | stop_backup_sync = set; | 811 | char *name, *buf = NULL; |
824 | else { | 812 | int (*threadfn)(void *data); |
825 | stop_master_sync = set; | 813 | int result = -ENOMEM; |
826 | stop_backup_sync = set; | ||
827 | } | ||
828 | } | ||
829 | 814 | ||
830 | static int sync_thread(void *startup) | 815 | IP_VS_DBG(7, "%s: pid %d\n", __func__, task_pid_nr(current)); |
831 | { | 816 | IP_VS_DBG(7, "Each ip_vs_sync_conn entry needs %Zd bytes\n", |
832 | DECLARE_WAITQUEUE(wait, current); | 817 | sizeof(struct ip_vs_sync_conn)); |
833 | mm_segment_t oldmm; | ||
834 | int state; | ||
835 | const char *name; | ||
836 | struct ip_vs_sync_thread_data *tinfo = startup; | ||
837 | 818 | ||
838 | /* increase the module use count */ | 819 | if (state == IP_VS_STATE_MASTER) { |
839 | ip_vs_use_count_inc(); | 820 | if (sync_master_thread) |
821 | return -EEXIST; | ||
840 | 822 | ||
841 | if (ip_vs_sync_state & IP_VS_STATE_MASTER && !sync_master_pid) { | 823 | strlcpy(ip_vs_master_mcast_ifn, mcast_ifn, |
842 | state = IP_VS_STATE_MASTER; | 824 | sizeof(ip_vs_master_mcast_ifn)); |
825 | ip_vs_master_syncid = syncid; | ||
826 | realtask = &sync_master_thread; | ||
843 | name = "ipvs_syncmaster"; | 827 | name = "ipvs_syncmaster"; |
844 | } else if (ip_vs_sync_state & IP_VS_STATE_BACKUP && !sync_backup_pid) { | 828 | threadfn = sync_thread_master; |
845 | state = IP_VS_STATE_BACKUP; | 829 | sock = make_send_sock(); |
830 | } else if (state == IP_VS_STATE_BACKUP) { | ||
831 | if (sync_backup_thread) | ||
832 | return -EEXIST; | ||
833 | |||
834 | strlcpy(ip_vs_backup_mcast_ifn, mcast_ifn, | ||
835 | sizeof(ip_vs_backup_mcast_ifn)); | ||
836 | ip_vs_backup_syncid = syncid; | ||
837 | realtask = &sync_backup_thread; | ||
846 | name = "ipvs_syncbackup"; | 838 | name = "ipvs_syncbackup"; |
839 | threadfn = sync_thread_backup; | ||
840 | sock = make_receive_sock(); | ||
847 | } else { | 841 | } else { |
848 | IP_VS_BUG(); | ||
849 | ip_vs_use_count_dec(); | ||
850 | return -EINVAL; | 842 | return -EINVAL; |
851 | } | 843 | } |
852 | 844 | ||
853 | daemonize(name); | 845 | if (IS_ERR(sock)) { |
854 | 846 | result = PTR_ERR(sock); | |
855 | oldmm = get_fs(); | 847 | goto out; |
856 | set_fs(KERNEL_DS); | 848 | } |
857 | |||
858 | /* Block all signals */ | ||
859 | spin_lock_irq(¤t->sighand->siglock); | ||
860 | siginitsetinv(¤t->blocked, 0); | ||
861 | recalc_sigpending(); | ||
862 | spin_unlock_irq(¤t->sighand->siglock); | ||
863 | 849 | ||
864 | /* set the maximum length of sync message */ | ||
865 | set_sync_mesg_maxlen(state); | 850 | set_sync_mesg_maxlen(state); |
851 | if (state == IP_VS_STATE_BACKUP) { | ||
852 | buf = kmalloc(sync_recv_mesg_maxlen, GFP_KERNEL); | ||
853 | if (!buf) | ||
854 | goto outsocket; | ||
855 | } | ||
866 | 856 | ||
867 | /* set up multicast address */ | 857 | tinfo = kmalloc(sizeof(*tinfo), GFP_KERNEL); |
868 | mcast_addr.sin_family = AF_INET; | 858 | if (!tinfo) |
869 | mcast_addr.sin_port = htons(IP_VS_SYNC_PORT); | 859 | goto outbuf; |
870 | mcast_addr.sin_addr.s_addr = htonl(IP_VS_SYNC_GROUP); | ||
871 | |||
872 | add_wait_queue(&sync_wait, &wait); | ||
873 | |||
874 | set_sync_pid(state, task_pid_nr(current)); | ||
875 | complete(tinfo->startup); | ||
876 | |||
877 | /* | ||
878 | * once we call the completion queue above, we should | ||
879 | * null out that reference, since its allocated on the | ||
880 | * stack of the creating kernel thread | ||
881 | */ | ||
882 | tinfo->startup = NULL; | ||
883 | |||
884 | /* processing master/backup loop here */ | ||
885 | if (state == IP_VS_STATE_MASTER) | ||
886 | sync_master_loop(); | ||
887 | else if (state == IP_VS_STATE_BACKUP) | ||
888 | sync_backup_loop(); | ||
889 | else IP_VS_BUG(); | ||
890 | |||
891 | remove_wait_queue(&sync_wait, &wait); | ||
892 | |||
893 | /* thread exits */ | ||
894 | |||
895 | /* | ||
896 | * If we weren't explicitly stopped, then we | ||
897 | * exited in error, and should undo our state | ||
898 | */ | ||
899 | if ((!stop_master_sync) && (!stop_backup_sync)) | ||
900 | ip_vs_sync_state -= tinfo->state; | ||
901 | 860 | ||
902 | set_sync_pid(state, 0); | 861 | tinfo->sock = sock; |
903 | IP_VS_INFO("sync thread stopped!\n"); | 862 | tinfo->buf = buf; |
904 | 863 | ||
905 | set_fs(oldmm); | 864 | task = kthread_run(threadfn, tinfo, name); |
865 | if (IS_ERR(task)) { | ||
866 | result = PTR_ERR(task); | ||
867 | goto outtinfo; | ||
868 | } | ||
906 | 869 | ||
907 | /* decrease the module use count */ | 870 | /* mark as active */ |
908 | ip_vs_use_count_dec(); | 871 | *realtask = task; |
872 | ip_vs_sync_state |= state; | ||
909 | 873 | ||
910 | set_stop_sync(state, 0); | 874 | /* increase the module use count */ |
911 | wake_up(&stop_sync_wait); | 875 | ip_vs_use_count_inc(); |
912 | 876 | ||
913 | /* | ||
914 | * we need to free the structure that was allocated | ||
915 | * for us in start_sync_thread | ||
916 | */ | ||
917 | kfree(tinfo); | ||
918 | return 0; | 877 | return 0; |
919 | } | ||
920 | |||
921 | |||
922 | static int fork_sync_thread(void *startup) | ||
923 | { | ||
924 | pid_t pid; | ||
925 | |||
926 | /* fork the sync thread here, then the parent process of the | ||
927 | sync thread is the init process after this thread exits. */ | ||
928 | repeat: | ||
929 | if ((pid = kernel_thread(sync_thread, startup, 0)) < 0) { | ||
930 | IP_VS_ERR("could not create sync_thread due to %d... " | ||
931 | "retrying.\n", pid); | ||
932 | msleep_interruptible(1000); | ||
933 | goto repeat; | ||
934 | } | ||
935 | 878 | ||
936 | return 0; | 879 | outtinfo: |
880 | kfree(tinfo); | ||
881 | outbuf: | ||
882 | kfree(buf); | ||
883 | outsocket: | ||
884 | sock_release(sock); | ||
885 | out: | ||
886 | return result; | ||
937 | } | 887 | } |
938 | 888 | ||
939 | 889 | ||
940 | int start_sync_thread(int state, char *mcast_ifn, __u8 syncid) | 890 | int stop_sync_thread(int state) |
941 | { | 891 | { |
942 | DECLARE_COMPLETION_ONSTACK(startup); | ||
943 | pid_t pid; | ||
944 | struct ip_vs_sync_thread_data *tinfo; | ||
945 | |||
946 | if ((state == IP_VS_STATE_MASTER && sync_master_pid) || | ||
947 | (state == IP_VS_STATE_BACKUP && sync_backup_pid)) | ||
948 | return -EEXIST; | ||
949 | |||
950 | /* | ||
951 | * Note that tinfo will be freed in sync_thread on exit | ||
952 | */ | ||
953 | tinfo = kmalloc(sizeof(struct ip_vs_sync_thread_data), GFP_KERNEL); | ||
954 | if (!tinfo) | ||
955 | return -ENOMEM; | ||
956 | |||
957 | IP_VS_DBG(7, "%s: pid %d\n", __func__, task_pid_nr(current)); | 892 | IP_VS_DBG(7, "%s: pid %d\n", __func__, task_pid_nr(current)); |
958 | IP_VS_DBG(7, "Each ip_vs_sync_conn entry need %Zd bytes\n", | ||
959 | sizeof(struct ip_vs_sync_conn)); | ||
960 | 893 | ||
961 | ip_vs_sync_state |= state; | ||
962 | if (state == IP_VS_STATE_MASTER) { | 894 | if (state == IP_VS_STATE_MASTER) { |
963 | strlcpy(ip_vs_master_mcast_ifn, mcast_ifn, | 895 | if (!sync_master_thread) |
964 | sizeof(ip_vs_master_mcast_ifn)); | 896 | return -ESRCH; |
965 | ip_vs_master_syncid = syncid; | ||
966 | } else { | ||
967 | strlcpy(ip_vs_backup_mcast_ifn, mcast_ifn, | ||
968 | sizeof(ip_vs_backup_mcast_ifn)); | ||
969 | ip_vs_backup_syncid = syncid; | ||
970 | } | ||
971 | |||
972 | tinfo->state = state; | ||
973 | tinfo->startup = &startup; | ||
974 | |||
975 | repeat: | ||
976 | if ((pid = kernel_thread(fork_sync_thread, tinfo, 0)) < 0) { | ||
977 | IP_VS_ERR("could not create fork_sync_thread due to %d... " | ||
978 | "retrying.\n", pid); | ||
979 | msleep_interruptible(1000); | ||
980 | goto repeat; | ||
981 | } | ||
982 | |||
983 | wait_for_completion(&startup); | ||
984 | |||
985 | return 0; | ||
986 | } | ||
987 | 897 | ||
898 | IP_VS_INFO("stopping master sync thread %d ...\n", | ||
899 | task_pid_nr(sync_master_thread)); | ||
988 | 900 | ||
989 | int stop_sync_thread(int state) | 901 | /* |
990 | { | 902 | * The lock synchronizes with sb_queue_tail(), so that we don't |
991 | DECLARE_WAITQUEUE(wait, current); | 903 | * add sync buffers to the queue, when we are already in |
904 | * progress of stopping the master sync daemon. | ||
905 | */ | ||
992 | 906 | ||
993 | if ((state == IP_VS_STATE_MASTER && !sync_master_pid) || | 907 | spin_lock(&ip_vs_sync_lock); |
994 | (state == IP_VS_STATE_BACKUP && !sync_backup_pid)) | 908 | ip_vs_sync_state &= ~IP_VS_STATE_MASTER; |
995 | return -ESRCH; | 909 | spin_unlock(&ip_vs_sync_lock); |
910 | kthread_stop(sync_master_thread); | ||
911 | sync_master_thread = NULL; | ||
912 | } else if (state == IP_VS_STATE_BACKUP) { | ||
913 | if (!sync_backup_thread) | ||
914 | return -ESRCH; | ||
915 | |||
916 | IP_VS_INFO("stopping backup sync thread %d ...\n", | ||
917 | task_pid_nr(sync_backup_thread)); | ||
918 | |||
919 | ip_vs_sync_state &= ~IP_VS_STATE_BACKUP; | ||
920 | kthread_stop(sync_backup_thread); | ||
921 | sync_backup_thread = NULL; | ||
922 | } else { | ||
923 | return -EINVAL; | ||
924 | } | ||
996 | 925 | ||
997 | IP_VS_DBG(7, "%s: pid %d\n", __func__, task_pid_nr(current)); | 926 | /* decrease the module use count */ |
998 | IP_VS_INFO("stopping sync thread %d ...\n", | 927 | ip_vs_use_count_dec(); |
999 | (state == IP_VS_STATE_MASTER) ? | ||
1000 | sync_master_pid : sync_backup_pid); | ||
1001 | |||
1002 | __set_current_state(TASK_UNINTERRUPTIBLE); | ||
1003 | add_wait_queue(&stop_sync_wait, &wait); | ||
1004 | set_stop_sync(state, 1); | ||
1005 | ip_vs_sync_state -= state; | ||
1006 | wake_up(&sync_wait); | ||
1007 | schedule(); | ||
1008 | __set_current_state(TASK_RUNNING); | ||
1009 | remove_wait_queue(&stop_sync_wait, &wait); | ||
1010 | |||
1011 | /* Note: no need to reap the sync thread, because its parent | ||
1012 | process is the init process */ | ||
1013 | |||
1014 | if ((state == IP_VS_STATE_MASTER && stop_master_sync) || | ||
1015 | (state == IP_VS_STATE_BACKUP && stop_backup_sync)) | ||
1016 | IP_VS_BUG(); | ||
1017 | 928 | ||
1018 | return 0; | 929 | return 0; |
1019 | } | 930 | } |
diff --git a/net/ipv4/ipvs/ip_vs_wlc.c b/net/ipv4/ipvs/ip_vs_wlc.c index 8a9d913261d8..772c3cb4eca1 100644 --- a/net/ipv4/ipvs/ip_vs_wlc.c +++ b/net/ipv4/ipvs/ip_vs_wlc.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * IPVS: Weighted Least-Connection Scheduling module | 2 | * IPVS: Weighted Least-Connection Scheduling module |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_wlc.c,v 1.13 2003/04/18 09:03:16 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * Peter Kese <peter.kese@ijs.si> | 5 | * Peter Kese <peter.kese@ijs.si> |
8 | * | 6 | * |
diff --git a/net/ipv4/ipvs/ip_vs_wrr.c b/net/ipv4/ipvs/ip_vs_wrr.c index 85c680add6df..1d6932d7dc97 100644 --- a/net/ipv4/ipvs/ip_vs_wrr.c +++ b/net/ipv4/ipvs/ip_vs_wrr.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * IPVS: Weighted Round-Robin Scheduling module | 2 | * IPVS: Weighted Round-Robin Scheduling module |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_wrr.c,v 1.12 2002/09/15 08:14:08 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * | 5 | * |
8 | * This program is free software; you can redistribute it and/or | 6 | * This program is free software; you can redistribute it and/or |
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c index f63006caea03..9892d4aca42e 100644 --- a/net/ipv4/ipvs/ip_vs_xmit.c +++ b/net/ipv4/ipvs/ip_vs_xmit.c | |||
@@ -1,8 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * ip_vs_xmit.c: various packet transmitters for IPVS | 2 | * ip_vs_xmit.c: various packet transmitters for IPVS |
3 | * | 3 | * |
4 | * Version: $Id: ip_vs_xmit.c,v 1.2 2002/11/30 01:50:35 wensong Exp $ | ||
5 | * | ||
6 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> | 4 | * Authors: Wensong Zhang <wensong@linuxvirtualserver.org> |
7 | * Julian Anastasov <ja@ssi.bg> | 5 | * Julian Anastasov <ja@ssi.bg> |
8 | * | 6 | * |