Commit 2a93e371 authored by Kirill Tkhai's avatar Kirill Tkhai Committed by Pavel Emelyanov

eventpoll: Use generic list for eventpoll files

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: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent f8143fd9
......@@ -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)
......
......@@ -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;
......@@ -1184,18 +1183,7 @@ int prepare_fds(struct pstree_item *me)
}
ret = open_fdinfos(me->pid->ns[0].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->ns[0].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);
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment