summaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorNick Piggin <npiggin@suse.de>2006-03-22 00:08:40 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2006-03-22 07:54:02 -0800
commit7835e98b2e3c66dba79cb0ff8ebb90a2fe030c29 (patch)
tree405a96eade34845dabe2f125b6c5eb095846869d /mm/hugetlb.c
parent70dc991d66cac40fdb07346dba2b5d862d732c34 (diff)
[PATCH] remove set_page_count() outside mm/
set_page_count usage outside mm/ is limited to setting the refcount to 1. Remove set_page_count from outside mm/, and replace those users with init_page_count() and set_page_refcounted(). This allows more debug checking, and tighter control on how code is allowed to play around with page->_count. Signed-off-by: Nick Piggin <npiggin@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm/hugetlb.c')
-rw-r--r--mm/hugetlb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 39d49ecea8e..20117a4b8ab 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -18,6 +18,7 @@
#include <asm/pgtable.h>
#include <linux/hugetlb.h>
+#include "internal.h"
const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL;
static unsigned long nr_huge_pages, free_huge_pages;
@@ -106,7 +107,7 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, unsigned long addr)
return NULL;
}
spin_unlock(&hugetlb_lock);
- set_page_count(page, 1);
+ set_page_refcounted(page);
for (i = 0; i < (HPAGE_SIZE/PAGE_SIZE); ++i)
clear_user_highpage(&page[i], addr);
return page;
@@ -152,7 +153,7 @@ static void update_and_free_page(struct page *page)
1 << PG_private | 1<< PG_writeback);
}
page[1].lru.next = NULL;
- set_page_count(page, 1);
+ set_page_refcounted(page);
__free_pages(page, HUGETLB_PAGE_ORDER);
}