summaryrefslogtreecommitdiff
path: root/mm/msync.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/msync.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/msync.c')
-rw-r--r--mm/msync.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/mm/msync.c b/mm/msync.c
index f292e0d27a51..2a2b31de8957 100644
--- a/mm/msync.c
+++ b/mm/msync.c
@@ -26,10 +26,14 @@ static int filemap_sync_pte(pte_t *ptep, struct vm_area_struct *vma,
pte_t pte = *ptep;
if (pte_present(pte) && pte_dirty(pte)) {
- struct page *page = pte_page(pte);
- if (VALID_PAGE(page) && !PageReserved(page) && ptep_test_and_clear_dirty(ptep)) {
- flush_tlb_page(vma, address);
- set_page_dirty(page);
+ struct page *page;
+ unsigned long pfn = pte_pfn(pte);
+ if (pfn_valid(pfn)) {
+ page = pfn_to_page(pfn);
+ if (!PageReserved(page) && ptep_test_and_clear_dirty(ptep)) {
+ flush_tlb_page(vma, address);
+ set_page_dirty(page);
+ }
}
}
return 0;