[CRIU] [PATCH v4 30/33] eventpoll: Use generic list for eventpoll files

Kirill Tkhai ktkhai at virtuozzo.com
Tue Dec 13 07:08:35 PST 2016


Since eventpoll opening time is set by dependencies
(see epoll_not_ready_tfd()), we may safely store them
in generic list.

v4: New

Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 criu/eventpoll.c        |    7 -------
 criu/files.c            |   12 ------------
 criu/include/rst_info.h |    1 -
 3 files changed, 20 deletions(-)

diff --git a/criu/eventpoll.c b/criu/eventpoll.c
index 4dd0a30..a094819 100644
--- a/criu/eventpoll.c
+++ b/criu/eventpoll.c
@@ -215,16 +215,9 @@ static int eventpoll_post_open(struct file_desc *d, int fd)
 	return ORV_OK;
 }
 
-static void eventpoll_collect_fd(struct file_desc *d,
-		struct fdinfo_list_entry *fle, struct rst_info *ri)
-{
-	list_add_tail(&fle->ps_list, &ri->eventpoll);
-}
-
 static struct file_desc_ops desc_ops = {
 	.type = FD_TYPES__EVENTPOLL,
 	.open = eventpoll_open,
-	.collect_fd = eventpoll_collect_fd,
 };
 
 static int collect_one_epoll_tfd(void *o, ProtobufCMessage *msg, struct cr_img *i)
diff --git a/criu/files.c b/criu/files.c
index 2c1fb6f..dc0cdf4 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -751,7 +751,6 @@ int prepare_fd_pid(struct pstree_item *item)
 
 	INIT_LIST_HEAD(&rst_info->used);
 	INIT_LIST_HEAD(&rst_info->fds);
-	INIT_LIST_HEAD(&rst_info->eventpoll);
 
 	if (item->ids == NULL) /* zombie */
 		return 0;
@@ -1141,18 +1140,7 @@ int prepare_fds(struct pstree_item *me)
 	}
 
 	ret = open_fdinfos(me->pid.virt, &rsti(me)->fds);
-	if (ret)
-		goto out_w;
 
-	/*
-	 * The eventpoll descriptors require all the other ones
-	 * to be already restored, thus we store them in a separate
-	 * list and restore at the very end.
-	 */
-	ret = open_fdinfos(me->pid.virt, &rsti(me)->eventpoll);
-	if (ret)
-		goto out_w;
-out_w:
 	close_service_fd(TRANSPORT_FD_OFF);
 	if (rsti(me)->fdt)
 		futex_inc_and_wake(&rsti(me)->fdt->fdt_lock);
diff --git a/criu/include/rst_info.h b/criu/include/rst_info.h
index 056d7db..82fbd56 100644
--- a/criu/include/rst_info.h
+++ b/criu/include/rst_info.h
@@ -28,7 +28,6 @@ struct _MmEntry;
 struct rst_info {
 	struct list_head	used;
 	struct list_head	fds;
-	struct list_head	eventpoll;
 
 	void			*premmapped_addr;
 	unsigned long		premmapped_len;



More information about the CRIU mailing list