patch-2.3.7 linux/ipc/shm.c

Next file: linux/kernel/acct.c
Previous file: linux/init/main.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.6/linux/ipc/shm.c linux/ipc/shm.c
@@ -675,7 +675,7 @@
 
 done:	/* pte_val(pte) == shp->shm_pages[idx] */
 	current->min_flt++;
-	atomic_inc(&mem_map[MAP_NR(pte_page(pte))].count);
+	get_page(mem_map + MAP_NR(pte_page(pte)));
 	return pte_page(pte);
 }
 
@@ -730,7 +730,7 @@
 		swap_free (swap_nr);
 		return 0;
 	}
-	if (atomic_read(&mem_map[MAP_NR(pte_page(page))].count) != 1)
+	if (page_count(mem_map + MAP_NR(pte_page(page))) != 1)
 		goto check_table;
 	shp->shm_pages[idx] = swap_nr;
 	rw_swap_page_nocache (WRITE, swap_nr, (char *) pte_page(page));
@@ -751,7 +751,7 @@
 
 	pte = pte_mkdirty(mk_pte(page, PAGE_SHARED));
 	shp->shm_pages[idx] = pte_val(pte);
-	atomic_inc(&mem_map[MAP_NR(page)].count);
+	get_page(mem_map + MAP_NR(page));
 	shm_rss++;
 
 	swap_free(entry);

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