patch-2.3.25 linux/mm/vmscan.c

Next file: linux/net/802/tr.c
Previous file: linux/mm/swapfile.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.24/linux/mm/vmscan.c linux/mm/vmscan.c
@@ -35,7 +35,8 @@
  */
 static int try_to_swap_out(struct vm_area_struct* vma, unsigned long address, pte_t * page_table, int gfp_mask)
 {
-	pte_t pte, entry;
+	pte_t pte;
+	swp_entry_t entry;
 	struct page * page;
 	int (*swapout)(struct page *, struct file *);
 
@@ -72,9 +73,9 @@
 	 * memory, and we should just continue our scan.
 	 */
 	if (PageSwapCache(page)) {
-		entry = get_pagecache_pte(page);
+		entry.val = page->index;
 		swap_duplicate(entry);
-		set_pte(page_table, entry);
+		set_pte(page_table, swp_entry_to_pte(entry));
 drop_pte:
 		vma->vm_mm->rss--;
 		flush_tlb_page(vma, address);
@@ -151,14 +152,14 @@
 	 * page with that swap entry.
 	 */
 	entry = acquire_swap_entry(page);
-	if (!pte_val(entry))
+	if (!entry.val)
 		goto out_failed; /* No swap space left */
 		
 	if (!(page = prepare_highmem_swapout(page)))
 		goto out_swap_free;
 
 	vma->vm_mm->rss--;
-	set_pte(page_table, entry);
+	set_pte(page_table, swp_entry_to_pte(entry));
 	vmlist_access_unlock(vma->vm_mm);
 
 	flush_tlb_page(vma, address);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)