From 5528f050dc6302b7f3cf66b97c5426f25ecfc6cc Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Fri, 3 May 2002 00:03:30 -0700 Subject: [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 --- fs/proc/array.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'fs/proc/array.c') diff --git a/fs/proc/array.c b/fs/proc/array.c index 28c6a3d4a3ef..c727d1487a1e 100644 --- a/fs/proc/array.c +++ b/fs/proc/array.c @@ -416,6 +416,7 @@ static inline void statm_pte_range(pmd_t * pmd, unsigned long address, unsigned do { pte_t page = *pte; struct page *ptpage; + unsigned long pfn; address += PAGE_SIZE; pte++; @@ -424,8 +425,11 @@ static inline void statm_pte_range(pmd_t * pmd, unsigned long address, unsigned ++*total; if (!pte_present(page)) continue; - ptpage = pte_page(page); - if ((!VALID_PAGE(ptpage)) || PageReserved(ptpage)) + pfn = pte_pfn(page); + if (!pfn_valid(pfn)) + continue; + ptpage = pfn_to_page(pfn); + if (PageReserved(ptpage)) continue; ++*pages; if (pte_dirty(page)) -- cgit v1.2.3