From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [RFC v14][PATCH 35/54] Support for share memory address spaces Date: Wed, 20 May 2009 10:55:56 -0700 Message-ID: <1242842156.13972.79.camel@nimitz> References: <1240961064-13991-1-git-send-email-orenl@cs.columbia.edu> <1240961064-13991-36-git-send-email-orenl@cs.columbia.edu> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1240961064-13991-36-git-send-email-orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Oren Laadan Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, Alexey Dobriyan List-Id: containers.vger.kernel.org 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