patch-2.1.37 linux/fs/nfs/write.c

Next file: linux/fs/nfsd/vfs.c
Previous file: linux/fs/ncpfs/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.36/linux/fs/nfs/write.c linux/fs/nfs/write.c
@@ -130,9 +130,9 @@
 
 #ifdef CONFIG_NFS_SWAP
 	/* async swap-out support */
-	if (clear_bit(PG_decr_after, &page->flags))
+	if (test_and_clear_bit(PG_decr_after, &page->flags))
 		atomic_dec(&page->count);
-	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);
 #endif
 }
@@ -530,7 +530,7 @@
 				page->offset);
 
 	req->wb_flags |= NFS_WRITE_WANTLOCK;
-	if (!set_bit(PG_locked, &page->flags)) {
+	if (!test_and_set_bit(PG_locked, &page->flags)) {
 		transfer_page_lock(req);
 	} else {
 		printk(KERN_WARNING "NFS oops in %s: can't lock page!\n",
@@ -719,7 +719,7 @@
 	if (!WB_HAVELOCK(req))
 		req->wb_flags |= NFS_WRITE_WANTLOCK;
 
-	if (WB_WANTLOCK(req) && set_bit(PG_locked, &page->flags)) {
+	if (WB_WANTLOCK(req) && test_and_set_bit(PG_locked, &page->flags)) {
 		dprintk("NFS:      page already locked in writeback_lock!\n");
 		task->tk_timeout = 2 * HZ;
 		rpc_sleep_on(&write_queue, task, NULL, NULL);

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