On Tue, 2009-04-28 at 19:24 -0400, Oren Laadan wrote:
> +static int checkpoint_task_objs(struct ckpt_ctx *ctx, struct task_struct *t)
> +{
> +       struct ckpt_hdr_task_objs *h;
> +       int mm_objref;
> +       int ret;
> +
> +       mm_objref = checkpoint_mm_obj(ctx, t);
> +       ckpt_debug("memory: objref %d\n", mm_objref);
> +       if (mm_objref < 0)
> +               return mm_objref;
> +
> +       h = ckpt_hdr_get_type(ctx, sizeof(*h), CKPT_HDR_TASK_OBJS);
> +       if (!h)
> +               return -ENOMEM;
> +
> +       h->mm_objref = mm_objref;
> +
> +       ret = ckpt_write_obj(ctx, (struct ckpt_hdr *) h);
> +       ckpt_hdr_put(ctx, h);
> +       return ret;
> +}

I wonder if this gets easier or harder to parse if you do this instead:

        ret = ckpt_write_obj(ctx, &h.h);

It is kinda what we already do for things that use container_of().  

-- Dave

_______________________________________________
Containers mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/containers

_______________________________________________
Devel mailing list
[email protected]
https://openvz.org/mailman/listinfo/devel

Reply via email to