patch-1.3.56 linux/fs/buffer.c
Next file: linux/fs/msdos/mmap.c
Previous file: linux/arch/alpha/kernel/signal.c
Back to the patch index
Back to the overall index
-  Lines: 32
 -  Date:
Mon Jan  8 08:14:54 1996
 -  Orig file: 
v1.3.55/linux/fs/buffer.c
 -  Orig date: 
Sat Jan  6 19:10:40 1996
 
diff -u --recursive --new-file v1.3.55/linux/fs/buffer.c linux/fs/buffer.c
@@ -1099,7 +1099,7 @@
  */
 int generic_readpage(struct inode * inode, struct page * page)
 {
-	unsigned long block;
+	unsigned long block, address;
 	int *p, nr[PAGE_SIZE/512];
 	int i;
 
@@ -1113,10 +1113,20 @@
 		p++;
 	} while (i > 0);
 
-	/* We should make this asynchronous, but this is good enough for now.. */
-	bread_page(page_address(page), inode->i_dev, nr, inode->i_sb->s_blocksize);
+	/*
+	 * We should make this asynchronous, but this is good enough for now..
+	 */
+
+	/* IO start */
+	page->count++;
+	address = page_address(page);
+	bread_page(address, inode->i_dev, nr, inode->i_sb->s_blocksize);
+
+	/* IO ready (this part should be in the "page ready callback" function) */
 	page->uptodate = 1;
 	wake_up(&page->wait);
+	free_page(address);
+
 	return 0;
 }
 
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this