Re: [PATCH] counting bug in svc_tcp_recvfrom causes panic for TCP

Andrew Morton (akpm@digeo.com)
Wed, 15 Jan 2003 15:28:44 -0800


Ted Phelps <phelps@dstc.edu.au> wrote:
>
> Perhaps a better solution would be to change page_address() to be
> consistently be a function for all memory layouts.

Assuredly. How about this?

diff -puN include/linux/mm.h~page_address-fix include/linux/mm.h
--- 25/include/linux/mm.h~page_address-fix 2003-01-15 15:23:45.000000000 -0800
+++ 25-akpm/include/linux/mm.h 2003-01-15 15:25:40.000000000 -0800
@@ -296,9 +296,11 @@ static inline void set_page_zone(struct
page->flags |= zone_num << ZONE_SHIFT;
}

-#define lowmem_page_address(page) \
- __va( ( ((page) - page_zone(page)->zone_mem_map) \
- + page_zone(page)->zone_start_pfn) << PAGE_SHIFT)
+static inline void *lowmem_page_address(struct page *page)
+{
+ return __va(((page - page_zone(page)->zone_mem_map)
+ + page_zone(page)->zone_start_pfn) << PAGE_SHIFT);
+}

#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
#define HASHED_PAGE_VIRTUAL

_

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/