]> xenbits.xensource.com Git - legacy/linux-2.6.18-xen.git/commitdiff
balloon: Fix building as a module (totalhigh_pages is not exported to
authorkfraser <kfraser@localhost.localdomain>
Thu, 12 Jul 2007 15:04:55 +0000 (16:04 +0100)
committerkfraser <kfraser@localhost.localdomain>
Thu, 12 Jul 2007 15:04:55 +0000 (16:04 +0100)
modules).
Signed-off-by: Keir Fraser <keir@xensource.com>
drivers/xen/balloon/balloon.c

index c09efa5d209966778a1af5eff7285b04c1bffb1b..0b75faf8c20162748527c8e603a30b7b4db58b3e 100644 (file)
@@ -83,7 +83,15 @@ static unsigned long frame_list[PAGE_SIZE / sizeof(unsigned long)];
 
 /* VM /proc information for memory */
 extern unsigned long totalram_pages;
+
+#ifndef MODULE
 extern unsigned long totalhigh_pages;
+#define inc_totalhigh_pages() (totalhigh_pages++)
+#define dec_totalhigh_pages() (totalhigh_pages--)
+#else
+#define inc_totalhigh_pages() ((void)0)
+#define dec_totalhigh_pages() ((void)0)
+#endif
 
 /* List of ballooned pages, threaded through the mem_map array. */
 static LIST_HEAD(ballooned_pages);
@@ -119,7 +127,7 @@ static void balloon_append(struct page *page)
        if (PageHighMem(page)) {
                list_add_tail(PAGE_TO_LIST(page), &ballooned_pages);
                bs.balloon_high++;
-               totalhigh_pages--;
+               dec_totalhigh_pages();
        } else {
                list_add(PAGE_TO_LIST(page), &ballooned_pages);
                bs.balloon_low++;
@@ -139,7 +147,7 @@ static struct page *balloon_retrieve(void)
 
        if (PageHighMem(page)) {
                bs.balloon_high--;
-               totalhigh_pages++;
+               inc_totalhigh_pages();
        }
        else
                bs.balloon_low--;