[lkml]   [2001]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: How does ramfs actually fills the page cache with data?
On Fri, Jun 22, 2001 at 05:45:27PM -0400, Ho Chak Hung wrote:
> In fs/ramfs/inode.c, how does ramfs actually fills the page
> cache with data? In the readpage operation, it only zero-fill
> the page if it didn't already exist in the page cache. However,
> how do I actually fill the page with data?

The page cache does it itself.

"readpage" is to move pages from the backing store into the page

"writepage" and friends is for updating the backing store with
the contents of the page cache.

There is no real backing store of ramfs, since ramfs data lives
completly in page cache.

But we cannot give the user random memory contents, so we zero it
out on readpage and prepare_write.

The data is copied with copy_{from,to}_user in the generic file
operations (look how ramfs_file_operations is defined and look at
the functions referenced), which read/write through page cache.


Ingo Oeser
Use ReiserFS to get a faster fsck and Ext2 to fsck slowly and gently.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:55    [W:0.017 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site