[CRIU] [PATCH] pstree: remove pid_to_virt and pstree_item_by_virt

Andrew Vagin avagin at virtuozzo.com
Wed Mar 9 12:11:58 PST 2016


On Wed, Mar 09, 2016 at 09:31:44PM +0300, Andrey Vagin wrote:
> From: Andrew Vagin <avagin at virtuozzo.com>
> 
> Nobody uses them

These helpers will be used to dump and restore autofs mounts,
so we need to drop this patch.

> 
> Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
> ---
>  criu/include/pstree.h |  2 --
>  criu/pstree.c         | 21 ---------------------
>  2 files changed, 23 deletions(-)
> 
> diff --git a/criu/include/pstree.h b/criu/include/pstree.h
> index 4a1d50b..ae0a1b5 100644
> --- a/criu/include/pstree.h
> +++ b/criu/include/pstree.h
> @@ -81,9 +81,7 @@ extern int prepare_pstree(void);
>  extern int dump_pstree(struct pstree_item *root_item);
>  
>  struct pstree_item *pstree_item_by_real(pid_t virt);
> -struct pstree_item *pstree_item_by_virt(pid_t virt);
>  
> -extern int pid_to_virt(pid_t pid);
>  extern bool pid_in_pstree(pid_t pid);
>  
>  struct task_entries;
> diff --git a/criu/pstree.c b/criu/pstree.c
> index f2a0ed4..5da572a 100644
> --- a/criu/pstree.c
> +++ b/criu/pstree.c
> @@ -971,17 +971,6 @@ bool restore_before_setsid(struct pstree_item *child)
>  	return false;
>  }
>  
> -struct pstree_item *pstree_item_by_virt(pid_t virt)
> -{
> -	struct pstree_item *item;
> -
> -	for_each_pstree_item(item) {
> -		if (item->pid.virt == virt)
> -			return item;
> -	}
> -	return NULL;
> -}
> -
>  struct pstree_item *pstree_item_by_real(pid_t real)
>  {
>  	struct pstree_item *item;
> @@ -993,16 +982,6 @@ struct pstree_item *pstree_item_by_real(pid_t real)
>  	return NULL;
>  }
>  
> -int pid_to_virt(pid_t real)
> -{
> -	struct pstree_item *item;
> -
> -	item = pstree_item_by_real(real);
> -	if (item)
> -		return item->pid.virt;
> -	return 0;
> -}
> -
>  bool pid_in_pstree(pid_t pid)
>  {
>  	return pstree_item_by_real(pid) != NULL;
> -- 
> 2.5.0
> 


More information about the CRIU mailing list