[CRIU] [PATCH v5 30/33] eventpoll: Use generic list for eventpoll files
Kirill Tkhai
ktkhai at virtuozzo.com
Mon Dec 26 06:29:52 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 28d68f7e9..3c6f12da6 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 0;
}
-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 841ee518d..2cfe24d48 100644
--- a/criu/files.c
+++ b/criu/files.c
@@ -781,7 +781,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;
@@ -1171,18 +1170,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 056d7db88..82fbd568c 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