Re: [RFC v6][PATCH 5/9] Restore memory address space
From: Dave Hansen
Date: Wed Oct 08 2008 - 11:36:06 EST
On Wed, 2008-10-08 at 06:19 -0400, Oren Laadan wrote:
>
> +static int cr_read_private_vma_contents(struct cr_ctx *ctx)
> +{
> + struct cr_hdr_pgarr *hh;
> + unsigned long nr_pages;
> + int parent, ret = 0;
> +
> + while (1) {
> + hh = cr_hbuf_get(ctx, sizeof(*hh));
> + parent = cr_read_obj_type(ctx, hh, sizeof(*hh), CR_HDR_PGARR);
> + if (parent != 0) {
> + if (parent < 0)
> + ret = parent;
> + else
> + ret = -EINVAL;
> + cr_hbuf_put(ctx, sizeof(*hh));
> + break;
> + }
> +
> + cr_debug("nr_pages %ld\n", (unsigned long) hh->nr_pages);
> +
> + nr_pages = hh->nr_pages;
> + cr_hbuf_put(ctx, sizeof(*hh));
> +
> + if (!nr_pages)
> + break;
> +
> + ret = cr_read_pages_vaddrs(ctx, nr_pages);
> + if (ret < 0)
> + break;
> + ret = cr_read_pages_contents(ctx);
> + if (ret < 0)
> + break;
> + cr_pgarr_reset_all(ctx);
> + }
> +
> + return ret;
> +}
This basically just uses a while(1) loop with 'break' instead of an
'out_err:' label and some gotos. That's kinda odd for the kernel.
-- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/