patch-2.1.37 linux/mm/filemap.c

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

diff -u --recursive --new-file v2.1.36/linux/mm/filemap.c linux/mm/filemap.c
@@ -171,7 +171,7 @@
 		switch (atomic_read(&page->count)) {
 			case 1:
 				/* If it has been referenced recently, don't free it */
-				if (clear_bit(PG_referenced, &page->flags))
+				if (test_and_clear_bit(PG_referenced, &page->flags))
 					break;
 
 				/* is it a page cache page? */
@@ -1340,7 +1340,7 @@
 		}
 
 lockit:
-		while (set_bit(PG_locked, &page->flags))
+		while (test_and_set_bit(PG_locked, &page->flags))
 			wait_on_page(page);
 
 		/*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov