]> git.hungrycats.org Git - linux/commit
[PATCH] block device layer: separate backing_dev_info infrastructure
authorAndrew Morton <akpm@osdl.org>
Fri, 21 May 2004 07:46:17 +0000 (00:46 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Fri, 21 May 2004 07:46:17 +0000 (00:46 -0700)
commit520808bf20e90fdbdb320264ba7dd5cf9d47dcac
tree29ebad5b83816df1d46051e8af28addd3d43ff72
parentf98c4469b160fb1be283b1c280548efc800aedcc
[PATCH] block device layer: separate backing_dev_info infrastructure

Sigh.  ramdisk almost works, except it loses data on umount.

This is because the files which are atop the ramdisk do not contribute to
dirty memory accounting, but they do need writeback.  So when sync() calls
sync_inodes_sb() to do the work, sync_inodes_sb() hopelessly underestimates
the number of pages which need writeback for a complete sync.

If you run `sync' enough times, everything eventually hits "disk" and all is
happy.

The root cause here is that the ramdisk and the files which it hosts shared
the same backing_dev_info.  This is inappropriate because the hosted files
*do* want to writeback and really should contribute to dirty memory
accounting. But the ramdisk inode itself wants neither.

So.  The patch sets up the infrastructure which permits a blockdev to provide
a separate backing_dev_info for the files which it hosts.  It's a bit of a
ramdisk-special.
fs/block_dev.c
fs/inode.c
include/linux/fs.h