aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-18 22:06:30 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-18 22:06:30 -0700
commit49c18faa72569c6b2dfdfa6a833aa2414e5e3b86 (patch)
treeb6be2600a6438e5fa36f8c33be5c2a6c425cf362 /mm
parent3d9d1320db840f032f47b3ad1cd31dde18675057 (diff)
downloadhistory-49c18faa72569c6b2dfdfa6a833aa2414e5e3b86.tar.gz
[PATCH] From: David Gibson <david@gibson.dropbear.id.au>
hugepage_vma() is both misleadingly named and unnecessary. On most archs it always returns NULL, and on IA64 the vma it returns is never used. The function's real purpose is to determine whether the address it is passed is a special hugepage address which must be looked up in hugepage pagetables, rather than being looked up in the normal pagetables (which might have specially marked hugepage PMDs or PTEs). This patch kills off hugepage_vma() and folds the logic it really needs into follow_huge_addr(). That now returns a (page *) if called on a special hugepage address, and an error encoded with ERR_PTR otherwise. This also requires tweaking the IA64 code to check that the hugepage PTE is present in follow_huge_addr() - previously this was guaranteed, since it was only called if the address was in an existing hugepage VMA, and hugepages are always prefaulted.
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 577d4582ded239..e54939da2caf92 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -657,11 +657,11 @@ follow_page(struct mm_struct *mm, unsigned long address, int write)
pmd_t *pmd;
pte_t *ptep, pte;
unsigned long pfn;
- struct vm_area_struct *vma;
+ struct page *page;
- vma = hugepage_vma(mm, address);
- if (vma)
- return follow_huge_addr(mm, vma, address, write);
+ page = follow_huge_addr(mm, address, write);
+ if (! IS_ERR(page))
+ return page;
pgd = pgd_offset(mm, address);
if (pgd_none(*pgd) || pgd_bad(*pgd))