[-mm patch] mm.h: fix page_zone compile error

From: Adrian Bunk
Date: Thu May 12 2005 - 16:50:15 EST


On Thu, May 12, 2005 at 03:31:00AM -0700, Andrew Morton wrote:
>...
> Changes since 2.6.12-rc3-mm3:
>...
> +sparsemem-memory-model.patch
>...
> More sparsemem stuff
>...


This causes the following compile error with gcc 3.4 on i386:

<-- snip -->

...
CC mm/hugetlb.o
mm/hugetlb.c: In function `enqueue_huge_page':
include/linux/mm.h:500: sorry, unimplemented: inlining failed in call to
'page_zone': function not considered for inlining
mm/hugetlb.c:486: sorry, unimplemented: called from here
make[1]: *** [mm/hugetlb.o] Error 1
make: *** [mm] Error 2

<-- snip -->


This patch fixes this compile error.

Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>

---

include/linux/mm.h | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)

--- linux-2.6.12-rc4-mm1-full/include/linux/mm.h.old 2005-05-12 22:54:04.000000000 +0200
+++ linux-2.6.12-rc4-mm1-full/include/linux/mm.h 2005-05-12 22:54:38.000000000 +0200
@@ -480,7 +480,16 @@
{
return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK;
}
-static inline struct zone *page_zone(struct page *page);
+
+struct zone;
+extern struct zone *zone_table[];
+
+static inline struct zone *page_zone(struct page *page)
+{
+ return zone_table[(page->flags >> ZONETABLE_PGSHIFT) &
+ ZONETABLE_MASK];
+}
+
static inline unsigned long page_to_nid(struct page *page)
{
if (FLAGS_HAS_NODE)
@@ -493,15 +502,6 @@
return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
}

-struct zone;
-extern struct zone *zone_table[];
-
-static inline struct zone *page_zone(struct page *page)
-{
- return zone_table[(page->flags >> ZONETABLE_PGSHIFT) &
- ZONETABLE_MASK];
-}
-
static inline void set_page_zone(struct page *page, unsigned long zone)
{
page->flags &= ~(ZONES_MASK << ZONES_PGSHIFT);

-
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/