[CRIU] Re: [PATCH 7/8] eventpoll: Order eventpoll files creation

Pavel Emelyanov xemul at parallels.com
Thu May 10 06:20:28 EDT 2012


On 05/05/2012 07:20 PM, Cyrill Gorcunov wrote:
> 
> Eventpoll files might have another eventpoll files
> as a target files to watch on. So when we restore
> them we need to do that in specified order.
> 
> Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
> ---
>  eventpoll.c         |   32 ++++++++++++++++++++++++++++++++
>  files.c             |   10 +++++++---
>  include/eventpoll.h |    1 +
>  3 files changed, 40 insertions(+), 3 deletions(-)
> 

> +	if (unlikely(le->fe.type == FDINFO_EVENTPOLL)) {
> +		if (is_eventpoll_dependent(&rst_info->eventpoll, le))
> +			list_add_tail(&le->ps_list, &rst_info->eventpoll);
> +		else
> +			list_add(&le->ps_list, &rst_info->eventpoll);
> +	} else
>  		list_add_tail(&le->ps_list, &rst_info->fds);

This is kinda messy. It would be better if this looked like

struct list_head *list;

if (le->fe.type != FDINFO_EVENTPOLL)
	list = &rst_info->fds;
else
	/*
	 * a good comment why this is such here
	 */
	list = find_eventpoll_dep();

list_add_tail(&le->ps_list, list);

the find_eventpoll_dep() returns the dependent entry or the head/tail of
the whole eventpoll list of none.

Thanks,
Pavel


More information about the CRIU mailing list