diff options
| author | Roman Zippel <zippel@linux-m68k.org> | 2002-05-03 00:03:30 -0700 |
|---|---|---|
| committer | Russell King <rmk@arm.linux.org.uk> | 2002-05-03 00:03:30 -0700 |
| commit | 5528f050dc6302b7f3cf66b97c5426f25ecfc6cc (patch) | |
| tree | ec3dedf4b740349f246460fcbb5e2698da1741ae /arch/sparc | |
| parent | 31efb48daafb03968411eb62e456df22796a8c9e (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 'arch/sparc')
| -rw-r--r-- | arch/sparc/mm/generic.c | 8 | ||||
| -rw-r--r-- | arch/sparc/mm/sun4c.c | 4 |
2 files changed, 8 insertions, 4 deletions
diff --git a/arch/sparc/mm/generic.c b/arch/sparc/mm/generic.c index 09d4247ac15c..5b2be11fd2fd 100644 --- a/arch/sparc/mm/generic.c +++ b/arch/sparc/mm/generic.c @@ -19,8 +19,12 @@ static inline void forget_pte(pte_t page) if (pte_none(page)) return; if (pte_present(page)) { - struct page *ptpage = pte_page(page); - if ((!VALID_PAGE(ptpage)) || PageReserved(ptpage)) + unsigned long pfn = pte_pfn(page); + struct page *ptpage; + if (!pfn_valid(pfn)) + return; + ptpage = pfn_to_page(pfn); + if (PageReserved(ptpage)) return; page_cache_release(ptpage); return; diff --git a/arch/sparc/mm/sun4c.c b/arch/sparc/mm/sun4c.c index 65836301aede..6e25abaa985d 100644 --- a/arch/sparc/mm/sun4c.c +++ b/arch/sparc/mm/sun4c.c @@ -1327,7 +1327,7 @@ static __u32 sun4c_get_scsi_one(char *bufptr, unsigned long len, struct sbus_bus unsigned long page; page = ((unsigned long)bufptr) & PAGE_MASK; - if (!VALID_PAGE(virt_to_page(page))) { + if (!virt_addr_valid(page)) { sun4c_flush_page(page); return (__u32)bufptr; /* already locked */ } @@ -2106,7 +2106,7 @@ static void sun4c_pte_clear(pte_t *ptep) { *ptep = __pte(0); } static int sun4c_pmd_bad(pmd_t pmd) { return (((pmd_val(pmd) & ~PAGE_MASK) != PGD_TABLE) || - (!VALID_PAGE(virt_to_page(pmd_val(pmd))))); + (!virt_addr_valid(pmd_val(pmd)))); } static int sun4c_pmd_present(pmd_t pmd) |
