summaryrefslogtreecommitdiffstats
path: root/mm/hugetlb.c
diff options
context:
space:
mode:
authorDavid Gibson2006-03-22 09:08:56 +0100
committerLinus Torvalds2006-03-22 16:54:03 +0100
commit27a85ef1b81300cfff06b4c8037e9914dfb09acc (patch)
tree1a8d9bc4c5611542273e57fc2606c12905906a57 /mm/hugetlb.c
parent[PATCH] hugepage: Strict page reservation for hugepage inodes (diff)
downloadkernel-qcow2-linux-27a85ef1b81300cfff06b4c8037e9914dfb09acc.tar.gz
kernel-qcow2-linux-27a85ef1b81300cfff06b4c8037e9914dfb09acc.tar.xz
kernel-qcow2-linux-27a85ef1b81300cfff06b4c8037e9914dfb09acc.zip
[PATCH] hugepage: Make {alloc,free}_huge_page() local
Originally, mm/hugetlb.c just handled the hugepage physical allocation path and its {alloc,free}_huge_page() functions were used from the arch specific hugepage code. These days those functions are only used with mm/hugetlb.c itself. Therefore, this patch makes them static and removes their prototypes from hugetlb.h. This requires a small rearrangement of code in mm/hugetlb.c to avoid a forward declaration. This patch causes no regressions on the libhugetlbfs testsuite (ppc64, POWER5). Signed-off-by: David Gibson <dwg@au1.ibm.com> Cc: William Lee Irwin III <wli@holomorphy.com> 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.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 27fad5d9bcf6..075877b1cbc0 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -88,6 +88,17 @@ static struct page *dequeue_huge_page(struct vm_area_struct *vma,
return page;
}
+static void free_huge_page(struct page *page)
+{
+ BUG_ON(page_count(page));
+
+ INIT_LIST_HEAD(&page->lru);
+
+ spin_lock(&hugetlb_lock);
+ enqueue_huge_page(page);
+ spin_unlock(&hugetlb_lock);
+}
+
static int alloc_fresh_huge_page(void)
{
static int nid = 0;
@@ -107,18 +118,8 @@ static int alloc_fresh_huge_page(void)
return 0;
}
-void free_huge_page(struct page *page)
-{
- BUG_ON(page_count(page));
-
- INIT_LIST_HEAD(&page->lru);
-
- spin_lock(&hugetlb_lock);
- enqueue_huge_page(page);
- spin_unlock(&hugetlb_lock);
-}
-
-struct page *alloc_huge_page(struct vm_area_struct *vma, unsigned long addr)
+static struct page *alloc_huge_page(struct vm_area_struct *vma,
+ unsigned long addr)
{
struct inode *inode = vma->vm_file->f_dentry->d_inode;
struct page *page;