[RFC v14][PATCH 35/54] Support for share memory address spaces

Oren Laadan orenl at cs.columbia.edu
Wed May 20 11:23:45 PDT 2009



Dave Hansen wrote:
> 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().  
> 

Fine with me.

Oren


More information about the Containers mailing list