[CRIU] [PATCH cr 4/9] tcp: split the list tcp_repair_sockets on rst and cpt parts

Andrey Vagin avagin at openvz.org
Mon Sep 17 03:50:09 EDT 2012


because here are two types of entries

Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
 sk-tcp.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/sk-tcp.c b/sk-tcp.c
index 647d061..1bab1c2 100644
--- a/sk-tcp.c
+++ b/sk-tcp.c
@@ -37,7 +37,8 @@ enum {
 #define TCPOPT_SACK_PERM TCPOPT_SACK_PERMITTED
 #endif
 
-static LIST_HEAD(tcp_repair_sockets);
+static LIST_HEAD(cpt_tcp_repair_sockets);
+static LIST_HEAD(rst_tcp_repair_sockets);
 
 static int tcp_repair_on(int fd)
 {
@@ -75,7 +76,7 @@ static int tcp_repair_establised(int fd, struct inet_sk_desc *sk)
 	if (ret < 0)
 		goto err3;
 
-	list_add_tail(&sk->rlist, &tcp_repair_sockets);
+	list_add_tail(&sk->rlist, &cpt_tcp_repair_sockets);
 	return 0;
 
 err3:
@@ -104,7 +105,7 @@ void tcp_unlock_all(void)
 {
 	struct inet_sk_desc *sk, *n;
 
-	list_for_each_entry_safe(sk, n, &tcp_repair_sockets, rlist)
+	list_for_each_entry_safe(sk, n, &cpt_tcp_repair_sockets, rlist)
 		tcp_unlock_one(sk);
 }
 
@@ -540,14 +541,14 @@ int restore_one_tcp(int fd, struct inet_sk_info *ii)
 
 void tcp_locked_conn_add(struct inet_sk_info *ii)
 {
-	list_add_tail(&ii->rlist, &tcp_repair_sockets);
+	list_add_tail(&ii->rlist, &rst_tcp_repair_sockets);
 }
 
 void tcp_unlock_connections(void)
 {
 	struct inet_sk_info *ii;
 
-	list_for_each_entry(ii, &tcp_repair_sockets, rlist)
+	list_for_each_entry(ii, &rst_tcp_repair_sockets, rlist)
 		nf_unlock_connection_info(ii);
 }
 
-- 
1.7.1



More information about the CRIU mailing list