Re: [RFC] [PATCH] Dirty pages in the page cache

Eric W. Biederman (ebiederm+eric@npwt.net)
12 Jan 1998 14:43:15 -0600


>>>>> "BH" == Bill Hawes <whawes@star.net> writes:

BH> The changes to pass a dentry argument to readpage and writepage was made
BH> so that filesystems that need a path to implement low-level operations
BH> will have it. The dentry argument in all cases carries the same inode
BH> that would have been passed in the older calls.

BH> The specific fix that motivated the changes was that we need to allow
BH> for separate NFS filehandles for each path leading to an inode, rather
BH> than storing just one path in the inode.

I can understand this. However this is not yet a complete, at least
not generically. From the page cache all you have is an inode.

How do you get a dentry?

I have a complete, working tested patch, for generically handling dirty
pages in the page cache. If all that is needed is an inode to write a
page, for `writepage' it works fine.

The question is: What is the proper way to handle this question.
I am skimming through the page cache. I find a dirty page. The dirty
bit on the page was set by update_page which had a dentry. But the
page itself hass no dentry. How do I handle this?

There are 3 possible solutions:

1) Have a default dentry, accessible from the inode to use with
writepage.
2) Add a dentry field into struct page, and every time the page is
written to by file_write update the dentry.
3) Revert write_page to use an inode.

I'm not certain how the NFS caching of writes (if there is any) works.
But write caching should be able to combine multiple writes to the same
file from different dentrys. How should this be accomplished?

I am totally open solutions, but I want a solution.

Question: Why does NFS need multiple file handles to actually write a
file? The appear to be interchangeable, as they all are used equally
for readpage.

Eric