[CRIU] [PATCH 5/5] unix: Shift code right (cont)

Pavel Emelyanov xemul at virtuozzo.com
Fri May 26 05:45:37 PDT 2017


This is the continuation of the previous patch.

Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
 criu/sk-unix.c | 49 ++++++++++++++++++++++---------------------------
 1 file changed, 22 insertions(+), 27 deletions(-)

diff --git a/criu/sk-unix.c b/criu/sk-unix.c
index 9c25757..44a8500 100644
--- a/criu/sk-unix.c
+++ b/criu/sk-unix.c
@@ -1480,37 +1480,32 @@ static int resolve_unix_peer(struct pprep_head *ph)
 	struct unix_sk_info *ui, *peer;
 
 	ui = container_of(ph, struct unix_sk_info, peer_resolve);
+	if (ui->peer)
+		goto out;
 
-	{
-		if (ui->peer)
-			goto out;
-
-		BUG_ON(!ui->ue->peer);
-
-		peer = find_unix_sk_by_ino(ui->ue->peer);
-
-		if (!peer) {
-			pr_err("FATAL: Peer %#x unresolved for %#x\n",
-					ui->ue->peer, ui->ue->ino);
-			return -1;
-		}
+	BUG_ON(!ui->ue->peer);
 
-		set_peer(ui, peer);
-		if (!peer->queuer)
-			peer->queuer = ui->ue->ino;
-		if (ui == peer)
-			/* socket connected to self %) */
-			goto out;
-		if (peer->ue->peer != ui->ue->ino)
-			goto out;
-
-		pr_info("Connected %#x -> %#x (%#x) flags %#x\n",
-				ui->ue->ino, ui->ue->peer, peer->ue->ino, ui->flags);
-		set_peer(peer, ui);
-		/* socketpair or interconnected sockets */
-		interconnected_pair(ui, peer);
+	peer = find_unix_sk_by_ino(ui->ue->peer);
+	if (!peer) {
+		pr_err("FATAL: Peer %#x unresolved for %#x\n",
+				ui->ue->peer, ui->ue->ino);
+		return -1;
 	}
 
+	set_peer(ui, peer);
+	if (!peer->queuer)
+		peer->queuer = ui->ue->ino;
+	if (ui == peer)
+		/* socket connected to self %) */
+		goto out;
+	if (peer->ue->peer != ui->ue->ino)
+		goto out;
+
+	pr_info("Connected %#x -> %#x (%#x) flags %#x\n",
+			ui->ue->ino, ui->ue->peer, peer->ue->ino, ui->flags);
+	set_peer(peer, ui);
+	/* socketpair or interconnected sockets */
+	interconnected_pair(ui, peer);
 out:
 	return 0;
 }
-- 
2.1.4



More information about the CRIU mailing list