diff -urN 2.2.17pre6/fs/buffer.c bwait/fs/buffer.c
--- 2.2.17pre6/fs/buffer.c	Fri Jun 23 15:24:53 2000
+++ bwait/fs/buffer.c	Fri Jun 23 15:28:42 2000
@@ -27,10 +27,6 @@
 /* invalidate_buffers/set_blocksize/sync_dev race conditions and
    fs corruption fixes, 1999, Andrea Arcangeli <andrea@suse.de> */
 
-/* Wait for dirty buffers to sync in sync_page_buffers.
- * 2000, Marcelo Tosatti <marcelo@conectiva.com.br>
- */
-
 #include <linux/malloc.h>
 #include <linux/locks.h>
 #include <linux/errno.h>
@@ -1468,30 +1464,6 @@
 #define BUFFER_BUSY_BITS	((1<<BH_Dirty) | (1<<BH_Lock) | (1<<BH_Protected))
 #define buffer_busy(bh)		((bh)->b_count || ((bh)->b_state & BUFFER_BUSY_BITS))
 
-static int sync_page_buffers(struct buffer_head *bh, int wait)
-{
-	struct buffer_head * tmp = bh;
-
-	do {
-		struct buffer_head *p = tmp;
-		tmp = tmp->b_this_page;
-		if (buffer_locked(p)) {
-			if (wait)
-				__wait_on_buffer(p);
-		} else if (buffer_dirty(p))
-			ll_rw_block(WRITE, 1, &p);
-	} while (tmp != bh);
-
-	do {
-		struct buffer_head *p = tmp;
-		tmp = tmp->b_this_page;
-		if (buffer_busy(p))
-			return 1;
-	} while (tmp != bh);
-
-	return 0;
-}
-
 /*
  * try_to_free_buffers() checks if all the buffers on this particular page
  * are unused, and free's the page if so.
@@ -1499,7 +1471,7 @@
  * Wake up bdflush() if this fails - if we're running low on memory due
  * to dirty buffers, we need to flush them out as quickly as possible.
  */
-int try_to_free_buffers(struct page * page_map, int wait)
+int try_to_free_buffers(struct page * page_map)
 {
 	struct buffer_head * tmp, * bh = page_map->buffers;
 
@@ -1510,7 +1482,6 @@
 		tmp = tmp->b_this_page;
 	} while (tmp != bh);
 
- succeed:
 	tmp = bh;
 	do {
 		struct buffer_head * p = tmp;
@@ -1530,13 +1501,6 @@
 	return 1;
 
  busy:
-	if (!sync_page_buffers(bh, wait))
-		/*
-		 * We can jump after the busy check because
-		 * we rely on the kernel lock.
-		 */
-		goto succeed;
-
 	wakeup_bdflush(0);
 	return 0;
 }
diff -urN 2.2.17pre6/include/linux/fs.h bwait/include/linux/fs.h
--- 2.2.17pre6/include/linux/fs.h	Fri Jun 23 15:24:58 2000
+++ bwait/include/linux/fs.h	Fri Jun 23 15:28:34 2000
@@ -754,7 +754,7 @@
 
 extern void refile_buffer(struct buffer_head * buf);
 extern void set_writetime(struct buffer_head * buf, int flag);
-extern int try_to_free_buffers(struct page *, int wait);
+extern int try_to_free_buffers(struct page *);
 
 extern int nr_buffers;
 extern long buffermem;
diff -urN 2.2.17pre6/mm/filemap.c bwait/mm/filemap.c
--- 2.2.17pre6/mm/filemap.c	Fri Jun 23 15:24:58 2000
+++ bwait/mm/filemap.c	Fri Jun 23 15:28:42 2000
@@ -141,12 +141,10 @@
 	unsigned long limit = num_physpages;
 	struct page * page;
 	int count;
-	int nr_dirty = 0;
-	
+
 	/* Make sure we scan all pages twice at priority 0. */
 	count = (limit << 1) >> priority;
 
- refresh_clock:
 	page = mem_map + clock;
 	do {
 		int referenced;
@@ -198,23 +196,14 @@
 
 		/* Is it a buffer page? */
 		if (page->buffers) {
-			/*
-			 * Wait for async IO to complete
-			 * at each 64 buffers
-			 */ 
-
-			int wait = ((gfp_mask & __GFP_IO) 
-				&& (!(nr_dirty++ % 64)));
-
 			if (buffer_under_min())
 				continue;
 			/*
 			 * We can sleep if we need to do some write
 			 * throttling.
 			 */
-
-			if (!try_to_free_buffers(page, wait))
-				goto refresh_clock;
+			if (!try_to_free_buffers(page))
+				continue;
 			return 1;
 		}