summaryrefslogtreecommitdiff
path: root/mm/vmalloc.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2002-05-03 00:03:30 -0700
committerRussell King <rmk@arm.linux.org.uk>2002-05-03 00:03:30 -0700
commit5528f050dc6302b7f3cf66b97c5426f25ecfc6cc (patch)
treeec3dedf4b740349f246460fcbb5e2698da1741ae /mm/vmalloc.c
parent31efb48daafb03968411eb62e456df22796a8c9e (diff)
[PATCH] 2.5.13: remove VALID_PAGE
This patch removes VALID_PAGE(), as the test was always too late for discontinous memory configuration. It is replaced with pfn_valid()/ virt_addr_valid(), which are used to test the original input value. Other helper functions: pte_pfn() - extract the page number from a pte pfn_to_page()/page_to_pfn() - convert a page number to/from a page struct
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r--mm/vmalloc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index fa1825cf13cb..5e269765466a 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -45,8 +45,12 @@ static inline void free_area_pte(pmd_t * pmd, unsigned long address, unsigned lo
if (pte_none(page))
continue;
if (pte_present(page)) {
- struct page *ptpage = pte_page(page);
- if (VALID_PAGE(ptpage) && (!PageReserved(ptpage)))
+ struct page *ptpage;
+ unsigned long pfn = pte_pfn(page);
+ if (!pfn_valid(pfn))
+ continue;
+ ptpage = pfn_to_page(pfn);
+ if (!PageReserved(ptpage))
__free_page(ptpage);
continue;
}