patch-1.3.47 linux/mm/filemap.c

Next file: linux/mm/memory.c
Previous file: linux/kernel/ksyms.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v1.3.46/linux/mm/filemap.c linux/mm/filemap.c
@@ -141,7 +141,8 @@
 	unsigned long entry = SWP_ENTRY(SHM_SWP_TYPE, MAP_NR(page));
 
 	set_pte(page_table, __pte(entry));
-	invalidate();
+	/* Yuck, perhaps a slightly modified swapout parameter set? */
+	invalidate_page(vma->vm_mm, (offset + vma->vm_start - vma->vm_offset));
 	error = filemap_write_page(vma, offset, page);
 	if (pte_val(*page_table) == entry)
 		pte_clear(page_table);
@@ -179,13 +180,14 @@
 		if (!pte_dirty(pte))
 			return 0;
 		set_pte(ptep, pte_mkclean(pte));
+		invalidate_page(vma->vm_mm, address);
 		page = pte_page(pte);
 		mem_map[MAP_NR(page)].count++;
 	} else {
 		if (pte_none(pte))
 			return 0;
 		pte_clear(ptep);
-		invalidate();
+		invalidate_page(vma->vm_mm, address);
 		if (!pte_present(pte)) {
 			swap_free(pte_val(pte));
 			return 0;
@@ -274,7 +276,7 @@
 		address = (address + PGDIR_SIZE) & PGDIR_MASK;
 		dir++;
 	}
-	invalidate();
+	invalidate_range(vma->vm_mm, end - size, end);
 	return error;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this