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

Submitted by Pavel Emelianov on May 26, 2017, 12:45 p.m.

Details

Message ID 0e4b614f-91ba-6234-0db2-452ecacc4f77@virtuozzo.com
State Accepted
Series "Tune-up post-prep engine"
Headers show

Commit Message

Pavel Emelianov May 26, 2017, 12:45 p.m.
This is the continuation of the previous patch.

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

Patch hide | download patch | download mbox

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;
 }