[CRIU] [crtools-bot] sockets: Factor dgram conn job structures more

Cyrill Gorcunov gorcunov at openvz.org
Tue Feb 7 08:27:09 EST 2012


The commit is pushed to "master" and will appear on git://github.com/cyrillos/crtools.git
--------------->
commit 8f70115461f9b5aece11361193fec8246f407b20
Author: Pavel Emelyanov <xemul at parallels.com>
Date:   Tue Feb 7 15:53:08 2012 +0400

    sockets: Factor dgram conn job structures more
    
    The unix_dgram_peer coincides with the unix_conn_job.
    
    Signed-off-by: Pavel Emelyanov <xemul at parallels.com>
    Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 sockets.c |   15 +++++----------
 1 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/sockets.c b/sockets.c
index 1f8f54d..13206c4 100644
--- a/sockets.c
+++ b/sockets.c
@@ -772,21 +772,15 @@ static int run_accept_jobs(void)
 	return 0;
 }
 
-struct unix_dgram_peer {
-	struct unix_dgram_peer	*next;
-	int			fd;
-	int			peer;
-};
-
 static struct unix_sk_listen	*dgram_bound[SK_HASH_SIZE];
-static struct unix_dgram_peer	*dgram_peer;
+static struct unix_conn_job	*dgram_peer;
 
 __gen_static_lookup_func(struct unix_sk_listen, lookup_dgram_bound, dgram_bound, ino, int, ino);
 
 static int run_connect_jobs_dgram(void)
 {
 	struct unix_sk_listen	*b;
-	struct unix_dgram_peer	*d;
+	struct unix_conn_job	*d;
 	int i;
 
 	for (d = dgram_peer; d; d = d->next) {
@@ -807,7 +801,7 @@ static int run_connect_jobs_dgram(void)
 	 * Free data we don't need anymore.
 	 */
 	for (d = dgram_peer; d;) {
-		struct unix_dgram_peer *h = d;
+		struct unix_conn_job *h = d;
 		d = d->next;
 		xfree(h);
 	}
@@ -879,12 +873,13 @@ static int open_unix_sk_dgram(int sk, struct unix_sk_entry *ue, int img_fd)
 		 * until peer is alive.
 		 */
 
-		struct unix_dgram_peer *d;
+		struct unix_conn_job *d;
 
 		d = xmalloc(sizeof(*d));
 		if (!d)
 			goto err;
 
+		d->flags = 0;
 		d->peer	= ue->peer;
 		d->fd	= ue->fd;
 		d->next = dgram_peer;


More information about the CRIU mailing list