patch-2.3.38 linux/mm/highmem.c

Next file: linux/mm/page_alloc.c
Previous file: linux/mm/filemap.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.37/linux/mm/highmem.c linux/mm/highmem.c
@@ -131,13 +131,17 @@
 static unsigned long map_new_virtual(struct page *page)
 {
 	unsigned long vaddr;
-	int count = LAST_PKMAP;
+	int count;
 
+start:
+	count = LAST_PKMAP;
 	/* Find an empty entry */
 	for (;;) {
 		last_pkmap_nr = (last_pkmap_nr + 1) & LAST_PKMAP_MASK;
-		if (!last_pkmap_nr)
+		if (!last_pkmap_nr) {
 			flush_all_zero_pkmaps();
+			count = LAST_PKMAP;
+		}
 		if (!pkmap_count[last_pkmap_nr])
 			break;	/* Found a usable entry */
 		if (--count)
@@ -161,7 +165,7 @@
 				return page->virtual;
 
 			/* Re-start */
-			count = LAST_PKMAP;
+			goto start;
 		}
 	}
 	vaddr = PKMAP_ADDR(last_pkmap_nr);

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