Re: [PATCH 8/9] pagemap: use page walker pte_hole() helper

Matt Mackall
2007-08-22T23:54:24Z

On Wed, Aug 22, 2007 at 04:18:13PM -0700, Dave Hansen wrote:
>
> I tried to do this a bit more incrementally, but it ended
> up just looking like an even worse mess. So, this does
> a a couple of different things.
>
> 1. use page walker pte_hole() helper, which
> 2. gets rid of the "next" value in "struct pagemapread"
> 3. allow 1-3 byte reads from pagemap. This at least
> ensures that we don't write over user memory if they
> ask us for 1 bytes and we tried to write 4.
> 4. Instead of trying to calculate what ranges of pages
> we are going to walk, simply start walking them,
> then return PAGEMAP_END_OF_BUFFER at the end of the
> buffer, error out, and stop walking.
> 5. enforce that reads must be algined to PM_ENTRY_BYTES
>
> Note that, despite these functional additions, and some
> nice new comments, this patch still removes more code
> than it adds.
>
> Signed-off-by: Dave Hansen <haveblue@us.ibm.com>

> + if (pm->count >= PM_ENTRY_BYTES)
> + __put_user(pfn pm->out);

I suppose I should have mentioned this typo when I spotted it
yesterday.. Will fix it on my end.

--
Mathematics is the supreme nostalgia of our time.