Give appropriate and separate backing_dev_info's to both the ramdisk blockdev
inode and to the files which live atop the ramdisk.

Everything works now.


---

 25-akpm/drivers/block/rd.c |   26 ++++++++++++++++----------
 1 files changed, 16 insertions(+), 10 deletions(-)

diff -puN drivers/block/rd.c~ramdisk-split-backing_dev_info drivers/block/rd.c
--- 25/drivers/block/rd.c~ramdisk-split-backing_dev_info	2004-05-19 02:33:07.411221776 -0700
+++ 25-akpm/drivers/block/rd.c	2004-05-19 02:33:07.415221168 -0700
@@ -310,20 +310,25 @@ static int rd_ioctl(struct inode *inode,
 }
 
 /*
- * The backing_dev_info is shared between files which are backed by the ramdisk
- * inode and by the ramdisk inode itself.  This is a bit unfortunate because
- * they really want separate semantics.  The files *do* want full writeback
- * and dirty-memory accounting treatment, whereas the ramdisk blockdev mapping
- * wants neither.
- *
- * So we make things look like a regular blockdev and the cheat in various ways
- * in the ramdisk inode's a_ops.
+ * This is the backing_dev_info for the blockdev inode itself.  It doesn't need
+ * writeback and it does not contribute to dirty memory accounting.
  */
-
 static struct backing_dev_info rd_backing_dev_info = {
 	.ra_pages	= 0,	/* No readahead */
 	.no_dirty_acct	= 1,	/* Does not contribute to dirty memory */
-	.no_writeback	= 0,	/* DOES need writeback */
+	.no_writeback	= 1,	/* Does not need writeback */
+	.unplug_io_fn	= default_unplug_io_fn,
+};
+
+/*
+ * This is the backing_dev_info for the files which live atop the ramdisk
+ * "device".  These files do need writeback and they do contribute to dirty
+ * memory accounting.
+ */
+static struct backing_dev_info rd_file_backing_dev_info = {
+	.ra_pages	= 0,	/* No readahead */
+	.no_dirty_acct	= 0,	/* Does contribute to dirty memory */
+	.no_writeback	= 0,	/* Does need writeback */
 	.unplug_io_fn	= default_unplug_io_fn,
 };
 
@@ -344,6 +349,7 @@ static int rd_open(struct inode *inode, 
 		mapping = inode->i_mapping;
 		mapping->a_ops = &ramdisk_aops;
 		mapping->backing_dev_info = &rd_backing_dev_info;
+		bdev->bd_inode_backing_dev_info = &rd_file_backing_dev_info;
 
 		/*
 		 * Deep badness.  rd_blkdev_pagecache_IO() needs to allocate

_