From f036bea1befae76dcccb2bb9b7ba6f3c892a23f6 Mon Sep 17 00:00:00 2001 From: kfraser Date: Thu, 12 Jul 2007 16:04:55 +0100 Subject: [PATCH] balloon: Fix building as a module (totalhigh_pages is not exported to modules). Signed-off-by: Keir Fraser --- drivers/xen/balloon/balloon.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/xen/balloon/balloon.c b/drivers/xen/balloon/balloon.c index c09efa5d..0b75faf8 100644 --- a/drivers/xen/balloon/balloon.c +++ b/drivers/xen/balloon/balloon.c @@ -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--; -- 2.39.5