All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH] c/r: get rid of ckpt_hdr_vpids - can be inferred at restart
Date: Tue, 30 Mar 2010 09:15:48 -0500	[thread overview]
Message-ID: <20100330141548.GC26351@us.ibm.com> (raw)
In-Reply-To: <1269930734-6887-1-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>

Quoting Oren Laadan (orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org):
> Signed-off-by: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>

Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

> ---
>  checkpoint/checkpoint.c        |   11 -----------
>  checkpoint/restart.c           |   12 ++++--------
>  include/linux/checkpoint_hdr.h |    8 --------
>  3 files changed, 4 insertions(+), 27 deletions(-)
> 
> diff --git a/checkpoint/checkpoint.c b/checkpoint/checkpoint.c
> index 76687f7..7bcc51d 100644
> --- a/checkpoint/checkpoint.c
> +++ b/checkpoint/checkpoint.c
> @@ -542,7 +542,6 @@ static int build_tree(struct ckpt_ctx *ctx)
>  static int checkpoint_tree(struct ckpt_ctx *ctx)
>  {
>  	struct ckpt_hdr_tree *h;
> -	struct ckpt_hdr_vpids *hvpids;
>  	int ret;
> 
>  	h = ckpt_hdr_get_type(ctx, sizeof(*h), CKPT_HDR_TREE);
> @@ -560,16 +559,6 @@ static int checkpoint_tree(struct ckpt_ctx *ctx)
>  	if (ret < 0)
>  		return ret;
> 
> -	hvpids = ckpt_hdr_get_type(ctx, sizeof(*hvpids), CKPT_HDR_VPIDS);
> -	if (!hvpids)
> -		return -ENOMEM;
> -
> -	hvpids->nr_vpids = ctx->nr_vpids;
> -
> -	ret = ckpt_write_obj(ctx, &hvpids->h);
> -	ckpt_hdr_put(ctx, hvpids);
> -	if (ret < 0)
> -		return ret;
>  	if (ctx->nr_vpids == 0)
>  		return 0;
> 
> diff --git a/checkpoint/restart.c b/checkpoint/restart.c
> index c25ce88..2102028 100644
> --- a/checkpoint/restart.c
> +++ b/checkpoint/restart.c
> @@ -767,16 +767,12 @@ static int restore_read_tree(struct ckpt_ctx *ctx)
>   */
>  static int restore_slurp_vpids(struct ckpt_ctx *ctx)
>  {
> -	struct ckpt_hdr_vpids *h;
> -	int size, ret;
> +	int size, ret, i;
> 
> -	h = ckpt_read_obj_type(ctx, sizeof(*h), CKPT_HDR_VPIDS);
> -	if (IS_ERR(h))
> -		return PTR_ERR(h);
> -	ctx->nr_vpids = h->nr_vpids;
> -	ckpt_hdr_put(ctx, h);
> +	for (i = 0; i < ctx->nr_pids; i++)
> +		ctx->nr_vpids += ctx->pids_arr[i].depth;
> 
> -	if (!ctx->nr_vpids)
> +	if (ctx->nr_vpids == 0)
>  		return 0;
> 
>  	size = sizeof(__s32) * ctx->nr_vpids;
> diff --git a/include/linux/checkpoint_hdr.h b/include/linux/checkpoint_hdr.h
> index 21624d7..36386ad 100644
> --- a/include/linux/checkpoint_hdr.h
> +++ b/include/linux/checkpoint_hdr.h
> @@ -117,8 +117,6 @@ enum {
>  #define CKPT_HDR_GROUPINFO CKPT_HDR_GROUPINFO
>  	CKPT_HDR_TASK_CREDS,
>  #define CKPT_HDR_TASK_CREDS CKPT_HDR_TASK_CREDS
> -	CKPT_HDR_VPIDS,
> -#define CKPT_HDR_VPIDS CKPT_HDR_VPIDS
> 
>  	/* 201-299: reserved for arch-dependent */
> 
> @@ -348,12 +346,6 @@ struct ckpt_pids {
>  	__s32 depth; /* pid namespace depth relative to container init */
>  } __attribute__((aligned(8)));
> 
> -/* number of vpids */
> -struct ckpt_hdr_vpids {
> -	struct ckpt_hdr h;
> -	__s32 nr_vpids;
> -} __attribute__((aligned(8)));
> -
>  /* pids */
>  #define CKPT_PID_NULL  -1
> 
> -- 
> 1.6.3.3

      parent reply	other threads:[~2010-03-30 14:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-30  6:32 [PATCH] c/r: get rid of ckpt_hdr_vpids - can be inferred at restart Oren Laadan
     [not found] ` <1269930734-6887-1-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-03-30  6:32   ` [PATCH] user-c/r: " Oren Laadan
     [not found]     ` <1269930734-6887-2-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
2010-03-30 19:39       ` Serge E. Hallyn
     [not found]         ` <20100330193936.GA12037-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-04-01  4:34           ` Oren Laadan
2010-03-30 14:15   ` Serge E. Hallyn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100330141548.GC26351@us.ibm.com \
    --to=serue-r/jw6+rmf7hqt0dzr+alfa@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.