Re: Implementing writepage

Charles Manning
2003-10-25T22:34:23Z

On Sunday 26 October 2003 05:18, David Woodhouse wrote:
> On Sat, 2003-10-25 at 22:27 +0000, Charles Manning wrote:
> > I need to therefore implement writepage and have a few questions:
>
> No you don't. This is flash -- people don't really need shared writable
> mmap; if they think they do, they need educating not pandering to.

It's a matter of what software they're using. Debian apt-get is the current
woesome application. Some people have vast YAFFS fs (512Mbytes or more) and
are starting to think of it as a real disk equivalent rather than just a
little pokey place to store a few configs. This means they want to run
regular software.

>
> > 1) Is there a generic writepage lurking somewhere that will use
> > prepare/commit_write instead?
>
> Don't think so. Offhand I don't see why it couldn't be done, but it's
> not what most file systems would want.

It seems wierd to me that generic_file_write uses the address_ops
prepare/commit_write via the page cache, yet mmap does not have a generic
funtion to do the same, even though this might not be the best approach for
efficiency.

>
> > 2) What fiddling is required with kmap & page flags within writepage or
> > is this all handled by the caller?
>
> You'll need to kmap the page since you actually want to touch the data
> with the CPU. You probably also need to mark the page uptodate when
> you're done. Take a look at the generic block writepage.
>
> > Any help appreciated.
>
> Ensure you have no memory allocations in the writepage() code path,
> unless they're done with (IIRC) GFP_NOIO.

Thanx

-- CHarles