Re: [patch] cache pipe buf page address for non-highmem arch

Andrew Morton
2007-03-23T01:01:29Z

On Thu, 22 Mar 2007 17:51:11 -0700 "Ken Chen" <kenchen@google.com> wrote:

> +#ifdef CONFIG_HIGHMEM
> +#define pipe_kmap kmap
> +#define pipe_kmap_atomic kmap_atomic
> +#else /* CONFIG_HIGHMEM */
> +static inline void *pipe_kmap(struct page *page)
> +{
> + return (void *) page->private;
> +}
> +static inline void *pipe_kmap_atomic(struct page *page, enum km_type type)
> +{
> + pagefault_disable();
> + return pipe_kmap(page);
> +}
> +#endif

If we're going to do this then we should also implement pipe_kunmap_atomic().
Relying upon kunmap_atomic() internals like this is weird-looking, and is fragile
against future changes to kunmap_atomic().