patch-2.2.18 linux/fs/buffer.c

Next file: linux/fs/dquot.c
Previous file: linux/fs/block_dev.c
Back to the patch index
Back to the overall index

diff -u --new-file --recursive --exclude-from /usr/src/exclude v2.2.17/fs/buffer.c linux/fs/buffer.c
@@ -1468,10 +1468,13 @@
 #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)
+static int sync_page_buffers(struct page * page, int wait)
 {
+	struct buffer_head * bh = page->buffers;
 	struct buffer_head * tmp = bh;
 
+	page->buffers = NULL;
+
 	do {
 		struct buffer_head *p = tmp;
 		tmp = tmp->b_this_page;
@@ -1482,6 +1485,8 @@
 			ll_rw_block(WRITE, 1, &p);
 	} while (tmp != bh);
 
+	page->buffers = bh;
+
 	do {
 		struct buffer_head *p = tmp;
 		tmp = tmp->b_this_page;
@@ -1533,7 +1538,7 @@
  busy:
 	too_many = (nr_buffers * bdf_prm.b_un.nfract/100);
 
-	if (!sync_page_buffers(bh, wait)) {
+	if (!sync_page_buffers(page_map, wait)) {
 
 		/* If a high percentage of the buffers are dirty, 
 		 * wake kflushd 

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