lkml.org 
[lkml]   [2008]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC v6][PATCH 5/9] Restore memory address space
From
Date
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



\
 
 \ /
  Last update: 2008-10-08 17:39    [W:0.081 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site