patch-2.1.37 linux/fs/buffer.c

Next file: linux/fs/dcache.c
Previous file: linux/fs/binfmt_elf.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.36/linux/fs/buffer.c linux/fs/buffer.c
@@ -1120,11 +1120,11 @@
 /* Run the hooks that have to be done when a page I/O has completed. */
 static inline void after_unlock_page (struct page * page)
 {
-	if (clear_bit(PG_decr_after, &page->flags))
+	if (test_and_clear_bit(PG_decr_after, &page->flags))
 		atomic_dec(&nr_async_pages);
-	if (clear_bit(PG_free_after, &page->flags))
+	if (test_and_clear_bit(PG_free_after, &page->flags))
 		__free_page(page);
-	if (clear_bit(PG_swap_unlock_after, &page->flags))
+	if (test_and_clear_bit(PG_swap_unlock_after, &page->flags))
 		swap_after_unlock_page(page->swap_unlock_entry);
 }
 

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